Skip to content

Commit 27f1065

Browse files
test: fix
1 parent 103dad4 commit 27f1065

5 files changed

Lines changed: 25 additions & 5 deletions

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ describe("webpack cli", () => {
77
it("should support typescript esnext file", async () => {
88
const [major, minor] = process.versions.node.split(".").map(Number);
99
const { exitCode, stderr, stdout } = await run(__dirname, ["-c", "./webpack.config.cts"], {
10-
env: { NODE_NO_WARNINGS: 1 },
10+
env: {
11+
NODE_NO_WARNINGS: 1,
12+
// Due nyc logic
13+
WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG: true,
14+
},
1115
// Fallback to `ts-node/esm` for old Node.js versions
1216
nodeOptions: major >= 22 && minor >= 6 ? [] : ["--experimental-loader=ts-node/esm"],
1317
});

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ describe("webpack cli", () => {
77
it("should support typescript esnext file", async () => {
88
const [major, minor] = process.versions.node.split(".").map(Number);
99
const { exitCode, stderr, stdout } = await run(__dirname, ["-c", "./webpack.config.mts"], {
10-
env: { NODE_NO_WARNINGS: 1 },
10+
env: {
11+
NODE_NO_WARNINGS: 1,
12+
// Due nyc logic
13+
WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG: true,
14+
},
1115
// Fallback to `ts-node/esm` for old Node.js versions
1216
nodeOptions: major >= 22 && minor >= 6 ? [] : ["--experimental-loader=ts-node/esm"],
1317
});

test/build/config-format/typescript-ts-node-require/typescript.test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ describe("webpack cli", () => {
66
it("should support typescript file", async () => {
77
const [major, minor] = process.versions.node.split(".").map(Number);
88
const { exitCode, stderr, stdout } = await run(__dirname, ["-c", "./webpack.config.ts"], {
9-
env: { NODE_NO_WARNINGS: 1 },
9+
env: {
10+
NODE_NO_WARNINGS: 1,
11+
// Due nyc logic
12+
WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG: true,
13+
},
1014
nodeOptions:
1115
major >= 22 && minor >= 6
1216
? ["--no-experimental-strip-types", "--require=ts-node/register"]

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ describe("webpack cli", () => {
77
it("should support typescript file", async () => {
88
const [major, minor] = process.versions.node.split(".").map(Number);
99
const { exitCode, stderr, stdout } = await run(__dirname, ["-c", "./webpack.config.ts"], {
10-
env: { NODE_NO_WARNINGS: 1 },
10+
env: {
11+
NODE_NO_WARNINGS: 1,
12+
// Due nyc logic
13+
WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG: true,
14+
},
1115
nodeOptions: major >= 22 && minor >= 6 ? ["--no-experimental-strip-types"] : [],
1216
});
1317

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ describe("webpack cli", () => {
66
it("should support typescript esnext file", async () => {
77
const [major, minor] = process.versions.node.split(".").map(Number);
88
const { exitCode, stderr, stdout } = await run(__dirname, ["-c", "./webpack.config.ts"], {
9-
env: { NODE_NO_WARNINGS: 1 },
9+
env: {
10+
NODE_NO_WARNINGS: 1,
11+
// Due nyc logic
12+
WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG: true,
13+
},
1014
// Fallback to `ts-node/esm` for old Node.js versions
1115
// We don't use Node.js@22 because it doesn't allow to load typescript files where we have `package.json` in root
1216
nodeOptions: major >= 22 && minor >= 6 ? [] : ["--experimental-loader=ts-node/esm"],

0 commit comments

Comments
 (0)