Skip to content

Commit

Permalink
Get things working on Node 22
Browse files Browse the repository at this point in the history
- Specify the tests on the command line (Node 22 needs this)

- Test Node 22 in GitHub actions build matrix

- Remove option `--experimental-json-modules`
  I don't think we are importing json files anywhere anymore?
  And I think it's been unflagged since Node 16

- Add option `--no-experimental-global-navigator`
  Our tests mock `Navigator`, and this will be an issue eventually
  Node 22 introduces it as an experimental global - let's not deal with it now
  • Loading branch information
bhousel committed Sep 10, 2024
1 parent 2e19409 commit cd97768
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [18, 20]
node-version: ['18', '20', '22']

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
node-options="--no-warnings --experimental-json-modules"
node-options="--no-warnings --no-experimental-global-navigator"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"test": "npm-run-all -s lint build test:unit test:browser",
"test:benchmark": "npm run test:unzip-benchmark-data && npx playwright test --workers=1 --config=test/benchmark/playwright.config.mjs && npm run test:cleanup-benchmark-data",
"test:browser": "karma start karma.conf.cjs",
"test:unit": "c8 node --test-reporter spec --test test/unit",
"test:unit": "c8 node --test-reporter spec --test test/unit/**/*.test.js",
"test:unzip-benchmark-data": "tar -xvf test/benchmark/tokyo_canned_data.zip -C test/benchmark",
"test:cleanup-benchmark-data": "rm test/benchmark/tokyo_*_canned_osm_data.js",
"translations": "node scripts/update_translations.js"
Expand Down

0 comments on commit cd97768

Please sign in to comment.