Skip to content

Commit

Permalink
test: use bytes in payload instead of utf-8 to better track messages
Browse files Browse the repository at this point in the history
in logs. Also check presence of message #9 which is the one missing.
  • Loading branch information
fryorcraken committed Nov 10, 2022
1 parent 2422494 commit dde6555
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/tests/tests/store.node.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe("Waku Store", () => {
expect(
await nwaku.sendMessage(
Nwaku.toMessageRpcQuery({
payload: utf8ToBytes(`Message ${i}`),
payload: new Uint8Array([i]),
contentTopic: TestContentTopic,
})
)
Expand Down Expand Up @@ -76,11 +76,11 @@ describe("Waku Store", () => {
}
await Promise.all(promises);

expect(messages?.length).eq(totalMsgs);
const result = messages?.findIndex((msg) => {
return bytesToUtf8(msg.payload!) === "Message 0";
return msg.payload![0]! === 9;
});
expect(result).to.not.eq(-1);
expect(messages?.length).eq(totalMsgs);
});

it("Generator, no message returned", async function () {
Expand Down

0 comments on commit dde6555

Please sign in to comment.