fix(test): check messages on custom pubsub topic

This commit is contained in:
Franck Royer 2022-07-25 17:11:36 +10:00 committed by fryorcraken.eth
parent 4a193e49e0
commit d18a5152ef
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
2 changed files with 3 additions and 3 deletions

View File

@ -90,7 +90,7 @@ describe("Waku Light Push [node only]", () => {
dbg("Waiting for message to show in nwaku");
while (msgs.length === 0) {
await delay(200);
msgs = await nwaku.messages();
msgs = await nwaku.messages(customPubSubTopic);
}
expect(msgs[0].contentTopic).to.equal(message.contentTopic);

View File

@ -217,7 +217,7 @@ export class Nwaku {
]);
}
async messages(): Promise<WakuMessage[]> {
async messages(pubsubTopic?: string): Promise<WakuMessage[]> {
this.checkProcess();
const isDefined = (msg: WakuMessage | undefined): msg is WakuMessage => {
@ -226,7 +226,7 @@ export class Nwaku {
const protoMsgs = await this.rpcCall<proto.WakuMessage[]>(
"get_waku_v2_relay_v1_messages",
[DefaultPubSubTopic]
[pubsubTopic ?? DefaultPubSubTopic]
);
const msgs = await Promise.all(