Skip to content

Commit 844901e

Browse files
Update tests for Node.js 22.12 (#16995)
* Update tests for Node.js 22.12 * Also CLI tests * And register
1 parent c322a1c commit 844901e

File tree

6 files changed

+34
-31
lines changed

6 files changed

+34
-31
lines changed

eslint.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ export default [
280280
"nodeGte14",
281281
"nodeGte12",
282282
"nodeGte20",
283-
"nodeGte23",
284-
"nodeLt23",
283+
"nodeGte22_12",
284+
"nodeLt22_12",
285285
"nodeGte12NoESM",
286286
"testFn",
287287
],

packages/babel-core/test/async.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import { itGte, itESM, itLt } from "$repo-utils";
1515
const nodeGte8 = itGte("8.0.0");
1616
const nodeGte14 = itGte("14.8.0");
1717

18-
// "minNodeVersion": "23.0.0" <-- For Ctrl+F when dropping node 22
19-
const nodeGte23 = itGte("23.0.0");
20-
const nodeLt23 = itLt("23.0.0");
18+
// "minNodeVersion": "22.0.0" <-- For Ctrl+F when dropping node 20
19+
const nodeGte22_12 = itGte("22.12.0");
20+
const nodeLt22_12 = itLt("22.12.0");
2121

2222
describe("asynchronicity", () => {
2323
const base = path.join(
@@ -252,7 +252,7 @@ describe("asynchronicity", () => {
252252
});
253253

254254
(supportsESM ? describe : describe.skip)(".mjs files", () => {
255-
nodeLt23("called synchronously", async () => {
255+
nodeLt22_12("called synchronously", async () => {
256256
process.chdir("plugin-mjs-native");
257257

258258
await expect(spawnTransformSync()).rejects.toThrow(
@@ -261,7 +261,7 @@ describe("asynchronicity", () => {
261261
);
262262
});
263263

264-
nodeGte23("called asynchronously", async () => {
264+
nodeGte22_12("called asynchronously", async () => {
265265
process.chdir("plugin-mjs-native");
266266

267267
await expect(spawnTransformSync()).resolves.toMatchObject({
@@ -344,7 +344,7 @@ describe("asynchronicity", () => {
344344
});
345345

346346
(supportsESM ? describe : describe.skip)(".mjs files", () => {
347-
nodeLt23("called synchronously", async () => {
347+
nodeLt22_12("called synchronously", async () => {
348348
process.chdir("preset-mjs-native");
349349

350350
await expect(spawnTransformSync()).rejects.toThrow(
@@ -353,7 +353,7 @@ describe("asynchronicity", () => {
353353
);
354354
});
355355

356-
nodeGte23("called synchronously", async () => {
356+
nodeGte22_12("called synchronously", async () => {
357357
process.chdir("preset-mjs-native");
358358

359359
await expect(spawnTransformSync()).resolves.toMatchObject({

packages/babel-core/test/config-chain.js

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ const getTargets = _getTargets.default || _getTargets;
1111

1212
const dirname = path.dirname(fileURLToPath(import.meta.url));
1313

14-
// "minNodeVersion": "23.0.0" <-- For Ctrl+F when dropping node 22
15-
const nodeGte23 = itGte("23.0.0");
16-
const nodeLt23 = itLt("23.0.0");
14+
// "minNodeVersion": "22.0.0" <-- For Ctrl+F when dropping node 20
15+
const nodeGte22_12 = itGte("22.12.0");
16+
const nodeLt22_12 = itLt("22.12.0");
1717

1818
import { isMJS, loadOptionsAsync, skipUnsupportedESM } from "./helpers/esm.js";
1919

@@ -1169,20 +1169,23 @@ describe("buildConfigChain", function () {
11691169
},
11701170
);
11711171

1172-
nodeLt23("should not load babel.config.mjs synchronously", async () => {
1173-
const { cwd, tmp, config } = await getTemp(
1174-
"babel-test-load-config-sync-babel.config.mjs",
1175-
);
1176-
const filename = tmp("src.js");
1172+
nodeLt22_12(
1173+
"should not load babel.config.mjs synchronously",
1174+
async () => {
1175+
const { cwd, tmp, config } = await getTemp(
1176+
"babel-test-load-config-sync-babel.config.mjs",
1177+
);
1178+
const filename = tmp("src.js");
11771179

1178-
await config("babel.config.mjs");
1180+
await config("babel.config.mjs");
11791181

1180-
expect(() => loadOptionsSync({ filename, cwd })).toThrow(
1181-
/is only supported when running Babel asynchronously/,
1182-
);
1183-
});
1182+
expect(() => loadOptionsSync({ filename, cwd })).toThrow(
1183+
/is only supported when running Babel asynchronously/,
1184+
);
1185+
},
1186+
);
11841187

1185-
nodeGte23("should load babel.config.mjs synchronously", async () => {
1188+
nodeGte22_12("should load babel.config.mjs synchronously", async () => {
11861189
const { cwd, tmp, config } = await getTemp(
11871190
"babel-test-load-config-sync-babel.config.mjs",
11881191
);
@@ -1282,7 +1285,7 @@ describe("buildConfigChain", function () {
12821285
});
12831286
});
12841287

1285-
nodeLt23("should not load .babelrc.mjs synchronously", async () => {
1288+
nodeLt22_12("should not load .babelrc.mjs synchronously", async () => {
12861289
const { cwd, tmp, config } = await getTemp(
12871290
"babel-test-load-config-sync-.babelrc.mjs",
12881291
);
@@ -1295,7 +1298,7 @@ describe("buildConfigChain", function () {
12951298
);
12961299
});
12971300

1298-
nodeGte23("should load .babelrc.mjs synchronously", async () => {
1301+
nodeGte22_12("should load .babelrc.mjs synchronously", async () => {
12991302
const { cwd, tmp, config } = await getTemp(
13001303
"babel-test-load-config-sync-.babelrc.mjs",
13011304
);

packages/babel-core/test/esm-cjs-integration.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { describeESM, describeGte, itLt } from "$repo-utils";
44

55
const require = createRequire(import.meta.url);
66

7-
// "minNodeVersion": "23.0.0" <-- For Ctrl+F when dropping node 22
8-
const nodeLt23 = itLt("23.0.0");
7+
// "minNodeVersion": "22.0.0" <-- For Ctrl+F when dropping node 20
8+
const nodeLt22_12 = itLt("22.12.0");
99

1010
async function run(name, ...flags) {
1111
return new Promise((res, rej) => {
@@ -116,15 +116,15 @@ describeESM("usage from cjs", () => {
116116
});
117117

118118
describeESM("sync loading of ESM plugins", () => {
119-
nodeLt23("without --experimental-require-module flag", async () => {
119+
nodeLt22_12("without --experimental-require-module flag", async () => {
120120
await expect(run("transform-sync-esm-plugin.mjs")).rejects.toThrow(
121121
"You appear to be using a native ECMAScript module plugin, which is " +
122122
"only supported when running Babel asynchronously or when using the " +
123123
"Node.js `--experimental-require-module` flag.",
124124
);
125125
});
126126

127-
describeGte("23.0.0")("without --experimental-require-module flag", () => {
127+
describeGte("22.12.0")("without --experimental-require-module flag", () => {
128128
it("sync", async () => {
129129
const { stdout } = await run(
130130
"transform-sync-esm-plugin.mjs",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ export function buildProcessTests(
923923
const env = {
924924
...process.env,
925925
FORCE_COLOR: "false",
926-
...(parseInt(process.versions.node) >= 23 && {
926+
...(parseInt(process.versions.node) >= 22 && {
927927
NODE_OPTIONS: "--disable-warning=ExperimentalWarning",
928928
}),
929929
...opts.env,

packages/babel-register/test/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ function spawnNodeAsync(args, cwd = __dirname, env = process.env) {
415415
cwd,
416416
env: {
417417
...env,
418-
...(parseInt(process.versions.node) >= 23 && {
418+
...(parseInt(process.versions.node) >= 22 && {
419419
NODE_OPTIONS:
420420
"--disable-warning=ExperimentalWarning " + (env.NODE_OPTIONS || ""),
421421
}),

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy