diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 687bbfc..3c38681 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - node-version: [16.x, 18.x] + node-version: [16.x, 18.x, 19.x] config: ["configs/ghostery.js", "configs/user-agent-ios.js"] steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7a8a74f..9ca4543 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,10 +15,10 @@ jobs: - name: Prepare repository run: git fetch --unshallow --tags - - name: Use Node.js 18 + - name: Use Node.js 19 uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 19.x - name: Install run: npm ci diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index f9ea679..dd35d18 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - node-version: [16.x, 18.x] + node-version: [16.x, 18.x, 19.x] steps: - uses: actions/checkout@v2 diff --git a/.tool-versions b/.tool-versions index 603e4f0..747f10e 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -nodejs 19.8.1 \ No newline at end of file +nodejs 19.9.0 \ No newline at end of file diff --git a/modules/antitracking/tests/unit/token-telemetry-test.es b/modules/antitracking/tests/unit/token-telemetry-test.es index b737acc..c158642 100644 --- a/modules/antitracking/tests/unit/token-telemetry-test.es +++ b/modules/antitracking/tests/unit/token-telemetry-test.es @@ -47,7 +47,7 @@ class MockQsWhitelist { } } -const tick = () => new Promise(resolve => setTimeout(resolve, 10)); +const tick = () => new Promise(resolve => setTimeout(resolve, 20)); const mockConfig = { telemetryMode: 2, diff --git a/modules/hpn-lite/tests/unit/server-public-key-accessor-test.es b/modules/hpn-lite/tests/unit/server-public-key-accessor-test.es index f0d487d..201e835 100644 --- a/modules/hpn-lite/tests/unit/server-public-key-accessor-test.es +++ b/modules/hpn-lite/tests/unit/server-public-key-accessor-test.es @@ -90,16 +90,15 @@ export default describeModule('hpn-lite/server-public-key-accessor', await storage.set(someStorageKey, entry); }; - const oldCrypto = global.crypto; + const oldImportKey = global.crypto && global.crypto.subtle.importKey; + let hadNoCrypto = false; beforeEach(async function () { /* eslint-disable-next-line global-require */ - global.crypto = global.crypto || { - subtle: { - importKey(...args) { - return MOCKS.importKey(...args); - }, - } - }; + if (!global.crypto) { + hadNoCrypto = true; + global.crypto = { subtle: {} }; + } + global.crypto.subtle.importKey = (...args) => MOCKS.importKey(...args); // in-memory implementation of storage MemoryPersistentMap = (await this.system.import('core/helpers/memory-map')).default; @@ -117,7 +116,10 @@ export default describeModule('hpn-lite/server-public-key-accessor', }); afterEach(function () { - global.crypto = oldCrypto; + global.crypto.subtle.importKey = oldImportKey; + if (hadNoCrypto) { + delete global.crypto; + } }); it('should be able to retrieve a key and cache it (happy path)', async function () {