Skip to content

Commit

Permalink
Fix Node 23 npm tests (#194)
Browse files Browse the repository at this point in the history
* Node 23 compatibility for the npm package tests

* rename the variable

* remove quotes

* fix --node-option syntax

* use separate options for Node.js 23

* try the alternative syntax
  • Loading branch information
mmomtchev authored Jan 14, 2025
1 parent cbf6580 commit 00a8723
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/test-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,18 @@ jobs:
npm install
- name: Install from npm
run: npm install --force gdal-async@${{ github.event.inputs.version }}
- name: Node options
shell: bash
run: echo 'MOCHA_NODE_OPTIONS=--v8-expose-gc' >> $GITHUB_ENV
if: matrix.node-version != '23.x'
- name: Node options
shell: bash
run: echo 'MOCHA_NODE_OPTIONS=--node-option=no-experimental-strip-types --node-option=expose-gc' >> $GITHUB_ENV
if: matrix.node-version == '23.x'
- name: Run the unit tests
run: |
cd test
npx mocha --reporter=tap -r ts-node/register -r _common.ts -r _hooks.ts --timeout 20000 --v8-expose-gc *.test.ts
npx mocha ${{ env.MOCHA_NODE_OPTIONS }} --reporter=tap -r ts-node/register -r _common.ts -r _hooks.ts --timeout 20000 *.test.ts
env:
TS_NODE_PROJECT: tsconfig.test.json

Expand Down Expand Up @@ -78,9 +86,17 @@ jobs:
npm install
- name: Rebuild with npm
run: npm install --verbose --force gdal-async@${{ github.event.inputs.version }} --build-from-source
- name: Node options
shell: bash
run: echo 'MOCHA_NODE_OPTIONS=--v8-expose-gc' >> $GITHUB_ENV
if: matrix.node-version != '23.x'
- name: Node options
shell: bash
run: echo 'MOCHA_NODE_OPTIONS=--node-option=no-experimental-strip-types --node-option=expose-gc' >> $GITHUB_ENV
if: matrix.node-version == '23.x'
- name: Run the unit tests
run: |
cd test
npx mocha --reporter=tap -r ts-node/register -r _common.ts -r _hooks.ts --timeout 20000 --v8-expose-gc *.test.ts
npx mocha ${{ env.MOCHA_NODE_OPTIONS }} --reporter=tap -r ts-node/register -r _common.ts -r _hooks.ts --timeout 20000 *.test.ts
env:
TS_NODE_PROJECT: tsconfig.test.json

0 comments on commit 00a8723

Please sign in to comment.