Skip to content

Commit b019f50

Browse files
authored
chore: test on Node.js 22 (#15035)
1 parent 69fe211 commit b019f50

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

.github/workflows/test-nightly.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
- uses: actions/checkout@v4
2121
with:
2222
persist-credentials: false
23-
- name: Use Node.js ${{ matrix.node-version }}
23+
- name: Use Node.js nightly build
2424
uses: actions/setup-node@v4
2525
with:
26-
node-version: 22-nightly
26+
node-version: 23-nightly
2727
cache: yarn
2828
- name: install
2929
run: yarn --immutable
@@ -52,10 +52,10 @@ jobs:
5252
- uses: actions/checkout@v4
5353
with:
5454
persist-credentials: false
55-
- name: Use Node.js LTS
55+
- name: Use Node.js nightly build
5656
uses: actions/setup-node@v4
5757
with:
58-
node-version: 22-nightly
58+
node-version: 23-nightly
5959
cache: yarn
6060
- name: install
6161
run: yarn --immutable

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
node-version: [16.x, 18.x, 20.x, 21.x]
18+
node-version: [16.x, 18.x, 20.x, 21.x, 22.x]
1919
name: Node v${{ matrix.node-version }}
2020
runs-on: ${{ inputs.os }}
2121

e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Time: <<REPLACED>>
1616
Ran all test suites matching native-esm-deep-cjs-reexport.test.js."
1717
`;
1818
19-
exports[`on node >=16.12.0 supports import assertions 1`] = `
19+
exports[`on node >=16.12.0 <22.0.0 supports import assertions 1`] = `
2020
"Test Suites: 1 passed, 1 total
2121
Tests: 2 passed, 2 total
2222
Snapshots: 0 total

e2e/__tests__/nativeEsm.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ test('does not enforce import assertions', () => {
137137
},
138138
);
139139

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

157-
onNodeVersions('<16.12.0', () => {
158+
onNodeVersions('<16.12.0 || >=22.0.0', () => {
158159
test('syntax error for import assertions', () => {
159160
const {exitCode, stderr, stdout} = runJest(
160161
DIR,

0 commit comments

Comments
 (0)