logos-messaging-js/src/lib/waku_message.spec.ts
2021-03-11 15:02:29 +11:00

16 lines
346 B
TypeScript

import { fc, testProp } from 'ava-fast-check';
import { Message } from './waku_message';
testProp(
'Waku message round trip binary serialisation',
[fc.string()],
(t, s) => {
const msg = Message.fromString(s);
const binary = msg.toBinary();
const actual = Message.fromBinary(binary);
t.true(actual.isEqualTo(msg));
}
);