Skip to content

Commit cd4f1f2

Browse files
test: fix
1 parent f3b0d16 commit cd4f1f2

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

jest.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ module.exports = {
77
transform: {
88
"^.+\\.(ts)?$": "ts-jest",
99
},
10-
testRegex: ["/test/.*\\.(test.js|test.ts)$"],
11-
moduleFileExtensions: ["ts", "js", "json"],
10+
testRegex: ["/test/.*\\.(test.js|test.cjs|test.mjs|test.ts|test.cts|test.mts)$"],
11+
moduleFileExtensions: ["ts", "cts", "mts", "js", "cjs", "mjs", "json"],
1212
snapshotResolver: "<rootDir>/scripts/snapshot-resolver.js",
1313
setupFilesAfterEnv: ["<rootDir>/scripts/setup-test.js"],
1414
globalTeardown: "<rootDir>/scripts/cleanup-test.js",

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
const { existsSync } = require("node:fs");
2-
const { resolve } = require("node:path");
3-
const { run } = require("../../../utils/test-utils");
1+
import { existsSync } from "node:fs";
2+
import { dirname, resolve } from "node:path";
3+
import { fileURLToPath } from "node:url";
4+
import { run } from "../../../utils/test-utils.js";
5+
6+
const __filename = fileURLToPath(import.meta.url);
7+
const __dirname = dirname(__filename);
48

59
describe("webpack cli", () => {
610
it("should support typescript esnext file", async () => {

0 commit comments

Comments
 (0)