logos-messaging-js/src/lib/waku_message.spec.ts

16 lines
346 B
TypeScript
Raw Normal View History

2021-03-10 16:22:49 +11:00
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));
}
);