Skip to content

Commit

Permalink
chore: test on Node.js 22 (#15035)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrazauskas committed Apr 25, 2024
1 parent 69fe211 commit b019f50
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js nightly build
uses: actions/setup-node@v4
with:
node-version: 22-nightly
node-version: 23-nightly
cache: yarn
- name: install
run: yarn --immutable
Expand Down Expand Up @@ -52,10 +52,10 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Node.js LTS
- name: Use Node.js nightly build
uses: actions/setup-node@v4
with:
node-version: 22-nightly
node-version: 23-nightly
cache: yarn
- name: install
run: yarn --immutable
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [16.x, 18.x, 20.x, 21.x]
node-version: [16.x, 18.x, 20.x, 21.x, 22.x]
name: Node v${{ matrix.node-version }}
runs-on: ${{ inputs.os }}

Expand Down
2 changes: 1 addition & 1 deletion e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Time: <<REPLACED>>
Ran all test suites matching native-esm-deep-cjs-reexport.test.js."
`;
exports[`on node >=16.12.0 supports import assertions 1`] = `
exports[`on node >=16.12.0 <22.0.0 supports import assertions 1`] = `
"Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Expand Down
7 changes: 4 additions & 3 deletions e2e/__tests__/nativeEsm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ test('does not enforce import assertions', () => {
},
);

// version where `vm` API gets `import assertions`
onNodeVersions('>=16.12.0', () => {
// support for import assertions in dynamic imports was added in Node.js 16.12.0
// support for import assertions was removed in Node.js 22.0.0
onNodeVersions('>=16.12.0 <22.0.0', () => {
test('supports import assertions', () => {
const {exitCode, stderr, stdout} = runJest(
DIR,
Expand All @@ -154,7 +155,7 @@ onNodeVersions('>=16.12.0', () => {
});
});

onNodeVersions('<16.12.0', () => {
onNodeVersions('<16.12.0 || >=22.0.0', () => {
test('syntax error for import assertions', () => {
const {exitCode, stderr, stdout} = runJest(
DIR,
Expand Down

0 comments on commit b019f50

Please sign in to comment.