From d900945b6dd0ed6adf8d90291598eb6bf9ec8768 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Fri, 24 Sep 2021 15:25:37 +1000 Subject: [PATCH 1/3] Add 'node' in test file names that only run on node --- karma.conf.js | 2 +- src/lib/{waku.spec.ts => waku.node.spec.ts} | 0 src/lib/waku_light_push/{index.spec.ts => index.node.spec.ts} | 0 src/lib/waku_message/{index.spec.ts => index.node.spec.ts} | 0 src/lib/waku_relay/{index.spec.ts => index.node.spec.ts} | 0 src/lib/waku_store/{index.spec.ts => index.node.spec.ts} | 0 src/test_utils/{log_file.spec.ts => log_file.node.spec.ts} | 0 src/test_utils/{nim_waku.spec.ts => nim_waku.node.spec.ts} | 0 8 files changed, 1 insertion(+), 1 deletion(-) rename src/lib/{waku.spec.ts => waku.node.spec.ts} (100%) rename src/lib/waku_light_push/{index.spec.ts => index.node.spec.ts} (100%) rename src/lib/waku_message/{index.spec.ts => index.node.spec.ts} (100%) rename src/lib/waku_relay/{index.spec.ts => index.node.spec.ts} (100%) rename src/lib/waku_store/{index.spec.ts => index.node.spec.ts} (100%) rename src/test_utils/{log_file.spec.ts => log_file.node.spec.ts} (100%) rename src/test_utils/{nim_waku.spec.ts => nim_waku.node.spec.ts} (100%) diff --git a/karma.conf.js b/karma.conf.js index fdceab411f..0176a32d10 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -17,7 +17,7 @@ module.exports = function (config) { singleRun: true, karmaTypescriptConfig: { bundlerOptions: { - entrypoints: /.*\.browser\.spec\.ts$/, + entrypoints: /^.*[^(node)]\.spec\.ts$/, }, coverageOptions: { instrumentation: false, diff --git a/src/lib/waku.spec.ts b/src/lib/waku.node.spec.ts similarity index 100% rename from src/lib/waku.spec.ts rename to src/lib/waku.node.spec.ts diff --git a/src/lib/waku_light_push/index.spec.ts b/src/lib/waku_light_push/index.node.spec.ts similarity index 100% rename from src/lib/waku_light_push/index.spec.ts rename to src/lib/waku_light_push/index.node.spec.ts diff --git a/src/lib/waku_message/index.spec.ts b/src/lib/waku_message/index.node.spec.ts similarity index 100% rename from src/lib/waku_message/index.spec.ts rename to src/lib/waku_message/index.node.spec.ts diff --git a/src/lib/waku_relay/index.spec.ts b/src/lib/waku_relay/index.node.spec.ts similarity index 100% rename from src/lib/waku_relay/index.spec.ts rename to src/lib/waku_relay/index.node.spec.ts diff --git a/src/lib/waku_store/index.spec.ts b/src/lib/waku_store/index.node.spec.ts similarity index 100% rename from src/lib/waku_store/index.spec.ts rename to src/lib/waku_store/index.node.spec.ts diff --git a/src/test_utils/log_file.spec.ts b/src/test_utils/log_file.node.spec.ts similarity index 100% rename from src/test_utils/log_file.spec.ts rename to src/test_utils/log_file.node.spec.ts diff --git a/src/test_utils/nim_waku.spec.ts b/src/test_utils/nim_waku.node.spec.ts similarity index 100% rename from src/test_utils/nim_waku.spec.ts rename to src/test_utils/nim_waku.node.spec.ts From 928d888ad829357bdc009edc0551acb5497ac0f5 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Fri, 24 Sep 2021 15:29:53 +1000 Subject: [PATCH 2/3] Remove 'browser' from test filename These tests are run both on node and in browser. --- src/lib/{discovery.browser.spec.ts => discovery.spec.ts} | 0 src/lib/waku_message/{index.browser.spec.ts => index.spec.ts} | 0 .../waku_message/{version_1.browser.spec.ts => version_1.spec.ts} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename src/lib/{discovery.browser.spec.ts => discovery.spec.ts} (100%) rename src/lib/waku_message/{index.browser.spec.ts => index.spec.ts} (100%) rename src/lib/waku_message/{version_1.browser.spec.ts => version_1.spec.ts} (100%) diff --git a/src/lib/discovery.browser.spec.ts b/src/lib/discovery.spec.ts similarity index 100% rename from src/lib/discovery.browser.spec.ts rename to src/lib/discovery.spec.ts diff --git a/src/lib/waku_message/index.browser.spec.ts b/src/lib/waku_message/index.spec.ts similarity index 100% rename from src/lib/waku_message/index.browser.spec.ts rename to src/lib/waku_message/index.spec.ts diff --git a/src/lib/waku_message/version_1.browser.spec.ts b/src/lib/waku_message/version_1.spec.ts similarity index 100% rename from src/lib/waku_message/version_1.browser.spec.ts rename to src/lib/waku_message/version_1.spec.ts From c990660fb9baa53b0dc9b151b93e054d9a208855 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Fri, 24 Sep 2021 17:15:46 +1000 Subject: [PATCH 3/3] Rename node only suites --- src/lib/waku.node.spec.ts | 2 +- src/lib/waku_light_push/index.node.spec.ts | 2 +- src/lib/waku_message/index.node.spec.ts | 2 +- src/lib/waku_relay/index.node.spec.ts | 6 ++++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/lib/waku.node.spec.ts b/src/lib/waku.node.spec.ts index d822c8bae3..ce50591170 100644 --- a/src/lib/waku.node.spec.ts +++ b/src/lib/waku.node.spec.ts @@ -17,7 +17,7 @@ import { generateSymmetricKey } from './waku_message/version_1'; const TestContentTopic = '/test/1/waku/utf8'; -describe('Waku Dial', function () { +describe('Waku Dial [node only]', function () { let waku: Waku; let waku2: Waku; let nimWaku: NimWaku; diff --git a/src/lib/waku_light_push/index.node.spec.ts b/src/lib/waku_light_push/index.node.spec.ts index 819b48bfb5..5ff779e960 100644 --- a/src/lib/waku_light_push/index.node.spec.ts +++ b/src/lib/waku_light_push/index.node.spec.ts @@ -10,7 +10,7 @@ import { WakuMessage } from '../waku_message'; const TestContentTopic = '/test/1/waku-light-push/utf8'; -describe('Waku Light Push', () => { +describe('Waku Light Push [node only]', () => { let waku: Waku; let nimWaku: NimWaku; diff --git a/src/lib/waku_message/index.node.spec.ts b/src/lib/waku_message/index.node.spec.ts index 9795c045e7..96dc506fea 100644 --- a/src/lib/waku_message/index.node.spec.ts +++ b/src/lib/waku_message/index.node.spec.ts @@ -26,7 +26,7 @@ const dbg = debug('waku:test:message'); const TestContentTopic = '/test/1/waku-message/utf8'; -describe('Waku Message: Node only', function () { +describe('Waku Message [node only]', function () { describe('Interop: Nim', function () { let waku: Waku; let nimWaku: NimWaku; diff --git a/src/lib/waku_relay/index.node.spec.ts b/src/lib/waku_relay/index.node.spec.ts index c03a187540..9689882b3b 100644 --- a/src/lib/waku_relay/index.node.spec.ts +++ b/src/lib/waku_relay/index.node.spec.ts @@ -18,8 +18,10 @@ const log = debug('waku:test'); const TestContentTopic = '/test/1/waku-relay/utf8'; -describe('Waku Relay', () => { - describe('js only', () => { +describe('Waku Relay [node only]', () => { + // Node needed as we don't have a way to connect 2 js waku + // nodes in the browser yet + describe('2 js nodes', () => { afterEach(function () { if (this.currentTest?.state === 'failed') { console.log(`Test failed, log file name is ${makeLogFileName(this)}`);