From 66270836f87d71f1d4e26801b04635c7cb0f206c Mon Sep 17 00:00:00 2001 From: "fryorcraken.eth" Date: Tue, 15 Nov 2022 14:09:04 +1100 Subject: [PATCH] test: need to specify in memory sqlite So that messages are not persisted between tests. --- packages/tests/src/nwaku.ts | 4 +++- packages/tests/tests/nwaku.node.spec.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/tests/src/nwaku.ts b/packages/tests/src/nwaku.ts index d3e9e3f9d9..e366e48b50 100644 --- a/packages/tests/src/nwaku.ts +++ b/packages/tests/src/nwaku.ts @@ -47,6 +47,7 @@ export interface Args { lightpush?: boolean; filter?: boolean; store?: boolean; + storeMessageDbUrl?: string; topics?: string; rpcPrivate?: boolean; websocketSupport?: boolean; @@ -422,7 +423,7 @@ export function argsToArray(args: Args): Array { for (const [key, value] of Object.entries(args)) { // Change the key from camelCase to kebab-case - const kebabKey = key.replace(/([A-Z])/, (_, capital) => { + const kebabKey = key.replace(/([A-Z])/g, (_, capital) => { return "-" + capital.toLowerCase(); }); @@ -441,6 +442,7 @@ export function defaultArgs(): Args { rpc: true, rpcAdmin: true, websocketSupport: true, + storeMessageDbUrl: "sqlite://:memory:", logLevel: LogLevel.Debug, }; } diff --git a/packages/tests/tests/nwaku.node.spec.ts b/packages/tests/tests/nwaku.node.spec.ts index 5299aab3f6..b1602bb2da 100644 --- a/packages/tests/tests/nwaku.node.spec.ts +++ b/packages/tests/tests/nwaku.node.spec.ts @@ -16,6 +16,7 @@ describe("nwaku", () => { "--rpc=true", "--rpc-admin=true", "--websocket-support=true", + "--store-message-db-url=sqlite://:memory:", "--log-level=DEBUG", "--ports-shift=42", ];