mirror of
https://github.com/waku-org/js-waku.git
synced 2025-01-14 06:24:27 +00:00
test: make it easier to understand test failure
This commit is contained in:
parent
e4d4fb1edd
commit
76251c922e
@ -228,10 +228,8 @@ describe("Waku Store", () => {
|
|||||||
nwaku = new Nwaku(makeLogFileName(this));
|
nwaku = new Nwaku(makeLogFileName(this));
|
||||||
await nwaku.start({ persistMessages: true, store: true, lightpush: true });
|
await nwaku.start({ persistMessages: true, store: true, lightpush: true });
|
||||||
|
|
||||||
const encryptedAsymmetricMessageText =
|
const encryptedAsymmetricMessageText = "asymmetric encryption";
|
||||||
"This message is encrypted for me using asymmetric";
|
const encryptedSymmetricMessageText = "symmetric encryption";
|
||||||
const encryptedSymmetricMessageText =
|
|
||||||
"This message is encrypted for me using symmetric encryption";
|
|
||||||
const clearMessageText =
|
const clearMessageText =
|
||||||
"This is a clear text message for everyone to read";
|
"This is a clear text message for everyone to read";
|
||||||
const otherEncMessageText =
|
const otherEncMessageText =
|
||||||
@ -307,11 +305,9 @@ describe("Waku Store", () => {
|
|||||||
decryptionParams: [{ key: privateKey }],
|
decryptionParams: [{ key: privateKey }],
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(messages?.length).eq(3);
|
expect(messages[0]?.payloadAsUtf8).to.eq(clearMessageText);
|
||||||
if (!messages) throw "Length was tested";
|
expect(messages[1]?.payloadAsUtf8).to.eq(encryptedSymmetricMessageText);
|
||||||
expect(messages[0].payloadAsUtf8).to.eq(clearMessageText);
|
expect(messages[2]?.payloadAsUtf8).to.eq(encryptedAsymmetricMessageText);
|
||||||
expect(messages[1].payloadAsUtf8).to.eq(encryptedSymmetricMessageText);
|
|
||||||
expect(messages[2].payloadAsUtf8).to.eq(encryptedAsymmetricMessageText);
|
|
||||||
|
|
||||||
!!waku1 && waku1.stop().catch((e) => console.log("Waku failed to stop", e));
|
!!waku1 && waku1.stop().catch((e) => console.log("Waku failed to stop", e));
|
||||||
!!waku2 && waku2.stop().catch((e) => console.log("Waku failed to stop", e));
|
!!waku2 && waku2.stop().catch((e) => console.log("Waku failed to stop", e));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user