Skip to content

Commit

Permalink
Update nodejs
Browse files Browse the repository at this point in the history
  • Loading branch information
chrmod committed Oct 12, 2023
1 parent 31a33b5 commit d058ac3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
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, 18, 19]
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

- 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, 18, 19]

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
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

0 comments on commit d058ac3

Please sign in to comment.