diff --git a/packages/tests/src/index.ts b/packages/tests/src/index.ts index 8db54403d3..6ccde12f94 100644 --- a/packages/tests/src/index.ts +++ b/packages/tests/src/index.ts @@ -7,5 +7,4 @@ export * from "./utils/index.js"; export * from "./constants.js"; -export * from "./lib/service_node.js"; -export * from "./message_collector.js"; +export * from "./lib/index.js"; diff --git a/packages/tests/src/lib/index.ts b/packages/tests/src/lib/index.ts new file mode 100644 index 0000000000..4e7ab34693 --- /dev/null +++ b/packages/tests/src/lib/index.ts @@ -0,0 +1,2 @@ +export * from "./message_collector.js"; +export * from "./service_node.js"; diff --git a/packages/tests/src/message_collector.ts b/packages/tests/src/lib/message_collector.ts similarity index 98% rename from packages/tests/src/message_collector.ts rename to packages/tests/src/lib/message_collector.ts index d1298f3c37..c0d714e660 100644 --- a/packages/tests/src/message_collector.ts +++ b/packages/tests/src/lib/message_collector.ts @@ -5,9 +5,8 @@ import { bytesToUtf8, utf8ToBytes } from "@waku/utils/bytes"; import { AssertionError, expect } from "chai"; import { equals } from "uint8arrays/equals"; -import { MessageRpcResponse } from "./types.js"; - -import { base64ToUtf8, delay, ServiceNode } from "./index.js"; +import { base64ToUtf8, delay, ServiceNode } from "../index.js"; +import { MessageRpcResponse } from "../types.js"; const log = new Logger("test:message-collector"); diff --git a/packages/tests/src/utils/async_fs.ts b/packages/tests/src/utils/async_fs.ts index c93f695044..a0cc20db7d 100644 --- a/packages/tests/src/utils/async_fs.ts +++ b/packages/tests/src/utils/async_fs.ts @@ -28,3 +28,5 @@ export async function waitForFile(path: string): Promise { } } while (!found); } + +export * from "./log_file.js"; diff --git a/packages/tests/src/utils/delay.ts b/packages/tests/src/utils/delay.ts index 59d8019117..90a6c7a6be 100644 --- a/packages/tests/src/utils/delay.ts +++ b/packages/tests/src/utils/delay.ts @@ -1,3 +1,5 @@ export function delay(ms: number): Promise { return new Promise((resolve) => setTimeout(resolve, ms)); } + +export * from "./async_fs.js"; diff --git a/packages/tests/src/utils/index.ts b/packages/tests/src/utils/index.ts index 704a4e5bdf..98f0c03a25 100644 --- a/packages/tests/src/utils/index.ts +++ b/packages/tests/src/utils/index.ts @@ -1,6 +1,4 @@ -export * from "./async_fs.js"; export * from "./generate_test_data.js"; -export * from "./log_file.js"; export * from "./teardown.js"; export * from "./random_array.js"; export * from "./wait_for_remote_peer_with_codec.js"; diff --git a/packages/tests/src/utils/teardown.ts b/packages/tests/src/utils/teardown.ts index 2d63728cf8..5bdee8e448 100644 --- a/packages/tests/src/utils/teardown.ts +++ b/packages/tests/src/utils/teardown.ts @@ -2,7 +2,7 @@ import { Waku } from "@waku/interfaces"; import { Logger } from "@waku/utils"; import pRetry from "p-retry"; -import { ServiceNode } from "../index.js"; +import { ServiceNode } from "../lib/service_node.js"; const log = new Logger("test:teardown"); diff --git a/packages/tests/tests/connection_manager.spec.ts b/packages/tests/tests/connection_manager.spec.ts index 6f5eeb8d1b..370b2bab90 100644 --- a/packages/tests/tests/connection_manager.spec.ts +++ b/packages/tests/tests/connection_manager.spec.ts @@ -14,7 +14,7 @@ import { createLightNode } from "@waku/sdk"; import { expect } from "chai"; import sinon, { SinonSpy, SinonStub } from "sinon"; -import { delay } from "../dist/delay.js"; +import { delay } from "../src/index.js"; import { makeLogFileName, ServiceNode, tearDownNodes } from "../src/index.js"; const TEST_TIMEOUT = 10_000; diff --git a/packages/tests/tests/filter/ping.node.spec.ts b/packages/tests/tests/filter/ping.node.spec.ts index c752d100bd..53d25443ca 100644 --- a/packages/tests/tests/filter/ping.node.spec.ts +++ b/packages/tests/tests/filter/ping.node.spec.ts @@ -3,8 +3,11 @@ import type { IFilterSubscription, LightNode } from "@waku/interfaces"; import { utf8ToBytes } from "@waku/utils/bytes"; import { expect } from "chai"; -import { ServiceNode, tearDownNodes } from "../../src/index.js"; -import { MessageCollector } from "../../src/message_collector.js"; +import { + MessageCollector, + ServiceNode, + tearDownNodes +} from "../../src/index.js"; import { runNodes, diff --git a/packages/tests/tests/relay/subscribe.node.spec.ts b/packages/tests/tests/relay/subscribe.node.spec.ts index 324820bf89..db7b6d376c 100644 --- a/packages/tests/tests/relay/subscribe.node.spec.ts +++ b/packages/tests/tests/relay/subscribe.node.spec.ts @@ -46,7 +46,7 @@ describe("Waku Relay, Subscribe", function () { }); await waku1.dial(waku2.libp2p.peerId); log.info("before each hook done"); - messageCollector = new MessageCollector(); + messageCollector = new MessageCollector(this.nwaku); }); afterEach(async function () { diff --git a/packages/tests/tests/store/index.node.spec.ts b/packages/tests/tests/store/index.node.spec.ts index f93c36238d..efec0e904b 100644 --- a/packages/tests/tests/store/index.node.spec.ts +++ b/packages/tests/tests/store/index.node.spec.ts @@ -93,7 +93,7 @@ describe("Waku Store, general", function () { } waku = await startAndConnectLightNode(nwaku); - const messageCollector = new MessageCollector(); + const messageCollector = new MessageCollector(nwaku); messageCollector.list = await processQueriedMessages( waku, [TestDecoder], @@ -125,7 +125,7 @@ describe("Waku Store, general", function () { ); waku = await startAndConnectLightNode(nwaku); - const messageCollector = new MessageCollector(); + const messageCollector = new MessageCollector(nwaku); messageCollector.list = await processQueriedMessages( waku, [TestDecoder, secondDecoder],