logos-delivery-js/src/lib/waku_message.spec.ts
Franck Royer 5c29394937
Migrate to jest for better debugging experience
ava is not yet integrated in popular IDEs.
2021-03-17 15:34:58 +11:00

16 lines
372 B
TypeScript

import { fc, testProp } from 'jest-fast-check';
import { Message } from './waku_message';
testProp(
'Waku message round trip binary serialization',
[fc.fullUnicodeString()],
(s) => {
const msg = Message.fromUtf8String(s);
const binary = msg.toBinary();
const actual = Message.fromBinary(binary);
expect(actual.isEqualTo(msg)).toBeTruthy();
}
);