mirror of
https://github.com/waku-org/js-waku.git
synced 2025-02-18 15:26:50 +00:00
test: compare all messages at once
Makes it easier to understand the order mismatch.
This commit is contained in:
parent
11c9823a9d
commit
74d7bb90c7
@ -225,13 +225,8 @@ describe("Waku Store", () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
expect(messages?.length).eq(totalMsgs);
|
expect(messages?.length).eq(totalMsgs);
|
||||||
for (let index = 0; index < totalMsgs; index++) {
|
const payloads = messages.map((msg) => msg.payload![0]!);
|
||||||
expect(
|
expect(payloads).to.deep.eq(Array.from(Array(totalMsgs).keys()));
|
||||||
messages?.findIndex((msg) => {
|
|
||||||
return msg.payload![0]! === index;
|
|
||||||
})
|
|
||||||
).to.eq(index);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Ordered Callback - Backward", async function () {
|
it("Ordered Callback - Backward", async function () {
|
||||||
@ -270,13 +265,8 @@ describe("Waku Store", () => {
|
|||||||
messages = messages.reverse();
|
messages = messages.reverse();
|
||||||
|
|
||||||
expect(messages?.length).eq(totalMsgs);
|
expect(messages?.length).eq(totalMsgs);
|
||||||
for (let index = 0; index < totalMsgs; index++) {
|
const payloads = messages.map((msg) => msg.payload![0]!);
|
||||||
expect(
|
expect(payloads).to.deep.eq(Array.from(Array(totalMsgs).keys()));
|
||||||
messages?.findIndex((msg) => {
|
|
||||||
return msg.payload![0]! === index;
|
|
||||||
})
|
|
||||||
).to.eq(index);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Generator, with asymmetric & symmetric encrypted messages", async function () {
|
it("Generator, with asymmetric & symmetric encrypted messages", async function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user