mirror of https://github.com/waku-org/js-waku.git
fix: explicit nwaku subscriptions in tests (#1572)
* Nwaku subscriptions explicit in tests * Subscription before each & renaming * Fix
This commit is contained in:
parent
e284c78701
commit
7905aa478b
|
@ -209,6 +209,17 @@ export class NimGoNode {
|
|||
return this.rpcCall<RpcInfoResponse>("get_waku_v2_debug_v1_info", []);
|
||||
}
|
||||
|
||||
async ensureSubscriptions(
|
||||
pubsubTopics: [string] = [DefaultPubSubTopic]
|
||||
): Promise<boolean> {
|
||||
this.checkProcess();
|
||||
|
||||
return this.rpcCall<boolean>(
|
||||
"post_waku_v2_relay_v1_subscriptions",
|
||||
pubsubTopics
|
||||
);
|
||||
}
|
||||
|
||||
async sendMessage(
|
||||
message: MessageRpcQuery,
|
||||
pubSubTopic: string = DefaultPubSubTopic
|
||||
|
|
|
@ -42,6 +42,9 @@ describe("Waku Filter V2: Subscribe", function () {
|
|||
[nwaku, waku] = await runNodes(this);
|
||||
subscription = await waku.filter.createSubscription();
|
||||
messageCollector = new MessageCollector(TestContentTopic);
|
||||
|
||||
// Nwaku subscribe to the default pubsub topic
|
||||
await nwaku.ensureSubscriptions();
|
||||
});
|
||||
|
||||
this.afterEach(async function () {
|
||||
|
|
|
@ -28,6 +28,9 @@ describe("Waku Filter V2: Unsubscribe", function () {
|
|||
[nwaku, waku] = await runNodes(this);
|
||||
subscription = await waku.filter.createSubscription();
|
||||
messageCollector = new MessageCollector(TestContentTopic);
|
||||
|
||||
// Nwaku subscribe to the default pubsub topic
|
||||
await nwaku.ensureSubscriptions();
|
||||
});
|
||||
|
||||
this.afterEach(async function () {
|
||||
|
|
|
@ -411,6 +411,9 @@ describe("Waku Relay [node only]", () => {
|
|||
|
||||
await waku.dial(await nwaku.getMultiaddrWithId());
|
||||
await waitForRemotePeer(waku, [Protocols.Relay]);
|
||||
|
||||
// Nwaku subscribe to the default pubsub topic
|
||||
await nwaku.ensureSubscriptions();
|
||||
});
|
||||
|
||||
afterEach(async function () {
|
||||
|
|
Loading…
Reference in New Issue