Skip to content

Commit e241bd8

Browse files
test: fix
1 parent f6c2a54 commit e241bd8

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

test/build/config-format/typescript-using-nodejs/typescript.test.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,14 @@ const { resolve } = require("path");
55

66
describe("webpack cli", () => {
77
it("should support typescript esnext file", async () => {
8-
const [major, minor] = process.versions.node.split(".").map(Number);
8+
const [major] = process.versions.node.split(".").map(Number);
99
const { exitCode, stderr, stdout } = await run(__dirname, ["-c", "./webpack.config.ts"], {
10-
env: {
11-
NODE_NO_WARNINGS: 1,
12-
// Due nyc logic
13-
WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG: true,
14-
},
10+
env: { NODE_NO_WARNINGS: 1 },
1511
// Fallback to `ts-node/esm` for old Node.js versions
16-
nodeOptions:
17-
major >= 22 && minor >= 6
18-
? ["--no-experimental-strip-types"]
19-
: ["--experimental-loader=ts-node/esm"],
12+
// We don't use Node.js@22 because it doesn't allow to load typescript files where we have `package.json` in root
13+
nodeOptions: major >= 24 ? [] : ["--experimental-loader=ts-node/esm"],
2014
});
2115

22-
console.log(stderr);
23-
2416
expect(stderr).toBeFalsy();
2517
expect(stdout).toBeTruthy();
2618
expect(exitCode).toBe(0);

0 commit comments

Comments
 (0)