test: use bytes in payload instead of utf-8 to better track messages

in logs. Also check presence of message #9 which is the one missing.
This commit is contained in:
fryorcraken.eth 2022-11-11 10:57:36 +11:00
parent 2422494bba
commit dde6555e01
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 3 additions and 3 deletions

View File

@ -48,7 +48,7 @@ describe("Waku Store", () => {
expect(
await nwaku.sendMessage(
Nwaku.toMessageRpcQuery({
payload: utf8ToBytes(`Message ${i}`),
payload: new Uint8Array([i]),
contentTopic: TestContentTopic,
})
)
@ -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 () {