-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathjest.config.js
More file actions
25 lines (19 loc) · 750 Bytes
/
jest.config.js
File metadata and controls
25 lines (19 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/** @type {import("jest").Config} **/
export default {
// The test environment that will be used for testing
testEnvironment: "node",
// The glob patterns Jest uses to detect test files
testMatch: ["**/tests/**/*.test.[jt]s?(x)"],
moduleFileExtensions: ["js", "ts"],
// Fixes the js extension imports
// https://github.com/swc-project/jest/issues/64#issuecomment-1029753225
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
},
transform: {
"^.+\\.[jt]sx?$": "@swc/jest", // targets files ending with .js, .jsx, .ts or .tsx
},
extensionsToTreatAsEsm: [".ts", ".tsx"],
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
modulePathIgnorePatterns: ["lib"],
};