mirror of https://github.com/waku-org/js-waku.git
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:
parent
2422494bba
commit
dde6555e01
|
@ -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 () {
|
||||
|
|
Loading…
Reference in New Issue