Skip to content

Commit fb2e365

Browse files
chore: Testing changes related to Node 23 (#16951)
Co-authored-by: Huáng Jùnliàng <[email protected]>
1 parent e550443 commit fb2e365

18 files changed

Lines changed: 125 additions & 55 deletions

File tree

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ aliases:
2424
executors:
2525
node-executor:
2626
docker:
27-
- image: cimg/node:22.10
27+
- image: cimg/node:current
2828
working_directory: ~/babel
2929

3030
jobs:

.github/workflows/ci.yml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Use Node.js latest
2020
uses: actions/setup-node@v4
2121
with:
22-
node-version: 22
22+
node-version: latest
2323
check-latest: true
2424
cache: "yarn"
2525
- name: 'Check or update Yarn cache (fix w/ "yarn install")'
@@ -40,7 +40,7 @@ jobs:
4040
- name: Use Node.js latest
4141
uses: actions/setup-node@v4
4242
with:
43-
node-version: 22
43+
node-version: latest
4444
check-latest: true
4545
cache: "yarn"
4646
- name: 'Check for unmet constraints (fix w/ "yarn constraints --fix")'
@@ -69,7 +69,7 @@ jobs:
6969
- name: Use Node.js latest
7070
uses: actions/setup-node@v4
7171
with:
72-
node-version: 22
72+
node-version: latest
7373
check-latest: true
7474
cache: "yarn"
7575
- name: Generate coverage report
@@ -104,7 +104,6 @@ jobs:
104104
run: yarn jest --ci
105105
env:
106106
BABEL_ENV: test
107-
NODE_OPTIONS: ${{matrix.node-version == '23' && '--disable-warning=ExperimentalWarning' || ''}}
108107
USE_ESM: true
109108

110109
build:
@@ -120,7 +119,7 @@ jobs:
120119
- name: Use Node.js latest
121120
uses: actions/setup-node@v4
122121
with:
123-
node-version: 22
122+
node-version: latest
124123
check-latest: true
125124
cache: "yarn"
126125
- name: Build babel artifacts
@@ -166,7 +165,7 @@ jobs:
166165
- name: Use Node.js latest
167166
uses: actions/setup-node@v4
168167
with:
169-
node-version: 22
168+
node-version: latest
170169
check-latest: true
171170
cache: "yarn"
172171
- name: Build babel artifacts
@@ -191,7 +190,7 @@ jobs:
191190
- name: Use Node.js latest
192191
uses: actions/setup-node@v4
193192
with:
194-
node-version: 22
193+
node-version: latest
195194
check-latest: true
196195
cache: "yarn"
197196
- name: Install
@@ -214,14 +213,14 @@ jobs:
214213
strategy:
215214
fail-fast: false
216215
matrix:
217-
node-version: [23, 20, 18, 16, 14, 12, 10, 8, 6]
216+
node-version: [22, 20, 18, 16, 14, 12, 10, 8, 6]
218217
steps:
219218
- name: Checkout code
220219
uses: actions/checkout@v4
221220
- name: Use Node.js latest # Run yarn on latest node
222221
uses: actions/setup-node@v4
223222
with:
224-
node-version: 22
223+
node-version: latest
225224
check-latest: true
226225
cache: "yarn"
227226
- name: Install
@@ -270,7 +269,7 @@ jobs:
270269
if: matrix.node-version == '6' || matrix.node-version == '8' || matrix.node-version == '10'
271270
uses: actions/setup-node@v4
272271
with:
273-
node-version: 22
272+
node-version: latest
274273

275274
build-babel8:
276275
name: Build Babel 8 Artifacts
@@ -285,7 +284,7 @@ jobs:
285284
- name: Use Node.js latest
286285
uses: actions/setup-node@v4
287286
with:
288-
node-version: 22
287+
node-version: latest
289288
check-latest: true
290289
cache: "yarn"
291290
- name: Use ESM
@@ -361,7 +360,7 @@ jobs:
361360
- name: Use Node.js latest
362361
uses: actions/setup-node@v4
363362
with:
364-
node-version: 22
363+
node-version: latest
365364
check-latest: true
366365
cache: "yarn"
367366
- name: Install
@@ -386,7 +385,7 @@ jobs:
386385
- name: Use Node.js latest
387386
uses: actions/setup-node@v4
388387
with:
389-
node-version: 22
388+
node-version: latest
390389
check-latest: true
391390
cache: "yarn"
392391
- name: Install
@@ -415,7 +414,7 @@ jobs:
415414
- name: Use Node.js latest
416415
uses: actions/setup-node@v4
417416
with:
418-
node-version: 22
417+
node-version: latest
419418
check-latest: true
420419
cache: "yarn"
421420
# See https://github.com/babel/babel/pull/12906
@@ -511,6 +510,12 @@ jobs:
511510
node-version: 16.6
512511
- name: Test Node.js 16.6
513512
run: node test/runtime-integration/node.cjs
513+
- name: Use Node.js 22
514+
uses: actions/setup-node@v4
515+
with:
516+
node-version: 22
517+
- name: Test Node.js 22
518+
run: node test/runtime-integration/node.cjs
514519

515520
eslint7-test:
516521
name: Test @babel/eslint-* with ESLint 7.5.0
@@ -522,7 +527,7 @@ jobs:
522527
- name: Use Node.js latest
523528
uses: actions/setup-node@v4
524529
with:
525-
node-version: 22
530+
node-version: latest
526531
check-latest: true
527532
cache: "yarn"
528533
- name: Install
@@ -547,7 +552,7 @@ jobs:
547552
- name: Use Node.js latest
548553
uses: actions/setup-node@v4
549554
with:
550-
node-version: 22
555+
node-version: latest
551556
check-latest: true
552557
cache: "yarn"
553558
- name: Install
@@ -572,7 +577,7 @@ jobs:
572577
- name: Use Node.js latest
573578
uses: actions/setup-node@v4
574579
with:
575-
node-version: 22
580+
node-version: latest
576581
check-latest: true
577582
- name: Checkout test runner
578583
uses: actions/checkout@v4
@@ -609,7 +614,7 @@ jobs:
609614
- name: Use Node.js latest
610615
uses: actions/setup-node@v4
611616
with:
612-
node-version: 22
617+
node-version: latest
613618
check-latest: true
614619
- name: Install
615620
run: yarn install

.github/workflows/e2e-tests-breaking-esm.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Use Node.js latest
2626
uses: actions/setup-node@v4
2727
with:
28-
node-version: 22
28+
node-version: "*"
2929
cache: "yarn"
3030
- name: Use ESM
3131
run: make use-esm
@@ -71,7 +71,7 @@ jobs:
7171
- name: Use Node.js latest
7272
uses: actions/setup-node@v4
7373
with:
74-
node-version: 22
74+
node-version: "*"
7575
- name: Get yarn cache directory path
7676
id: yarn-cache-dir-path
7777
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

.github/workflows/e2e-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Use Node.js latest
2626
uses: actions/setup-node@v4
2727
with:
28-
node-version: 22
28+
node-version: "*"
2929
cache: "yarn"
3030
- name: Publish
3131
run: ./scripts/integration-tests/publish-local.sh
@@ -64,7 +64,7 @@ jobs:
6464
- name: Use Node.js latest
6565
uses: actions/setup-node@v4
6666
with:
67-
node-version: 22
67+
node-version: "*"
6868
- name: Get yarn cache directory path
6969
id: yarn-cache-dir-path
7070
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

.github/workflows/update-compat-data.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Use Node.js latest
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: 22
25+
node-version: "*"
2626
- name: Get latest kangax/compat-table commit
2727
id: lastCommit
2828
run: echo "sha1=$(./scripts/update-compat-table/get-last-commit.sh)" >> $GITHUB_OUTPUT

.github/workflows/update-parser-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Use Node.js latest
2626
uses: actions/setup-node@v4
2727
with:
28-
node-version: 22
28+
node-version: "*"
2929
cache: "yarn"
3030
- name: Get latest test262 version
3131
id: test262

.github/workflows/update-windows-fixtures.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
- name: Use Node.js latest
5151
uses: actions/setup-node@v4
5252
with:
53-
node-version: 22
53+
node-version: "*"
5454
cache: "yarn"
5555

5656
- name: Install and build

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ packages/babel-standalone/examples/**
88
packages/babel-parser/test/expressions/**
99
scripts/integration-tests/fixtures/**
1010
packages/babel-parser/test/schema.json
11-
test/runtime-integration/node.cjs
1211

1312
CHANGELOG.md
1413
.github/*.md

packages/babel-core/test/targets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ describe("browserslist", () => {
135135
loadOptionsSync({
136136
cwd: join(cwd, "fixtures", "targets"),
137137
filename: "./node_modules/dep/test.js",
138-
babelrcRoots: ["./node_modules/dep"],
138+
babelrcRoots: ["./node_modules/dep/"],
139139
}).targets,
140140
).toEqual({ edge: "14.0.0" });
141141
});

packages/babel-helper-transform-fixture-test-runner/src/index.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ function normalizeOutput(
474474
) {
475475
const dir = path.resolve(
476476
path.dirname(fileURLToPath(import.meta.url)),
477-
"../../..",
477+
"../../../",
478478
);
479479
const symbol = "<CWD>";
480480
let result = code
@@ -920,7 +920,14 @@ export function buildProcessTests(
920920
: [test.binLoc];
921921

922922
args = args.concat(opts.args);
923-
const env = { ...process.env, FORCE_COLOR: "false", ...opts.env };
923+
const env = {
924+
...process.env,
925+
FORCE_COLOR: "false",
926+
...(parseInt(process.versions.node) >= 23 && {
927+
NODE_OPTIONS: "--disable-warning=ExperimentalWarning",
928+
}),
929+
...opts.env,
930+
};
924931
const child = spawn(process.execPath, args, {
925932
env,
926933
cwd: tmpLoc,

0 commit comments

Comments
 (0)