Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update nodejs #91

Merged
merged 3 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 19.8.1
nodejs 19.9.0
2 changes: 1 addition & 1 deletion modules/antitracking/tests/unit/token-telemetry-test.es
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
20 changes: 11 additions & 9 deletions modules/hpn-lite/tests/unit/server-public-key-accessor-test.es
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 () {
Expand Down