-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
27 lines (25 loc) · 826 Bytes
/
jest.config.js
File metadata and controls
27 lines (25 loc) · 826 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
26
27
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable no-undef */
const { pathsToModuleNameMapper } = require("ts-jest/utils");
const config = require("./tsconfig.json");
const remappedPaths = pathsToModuleNameMapper(config.compilerOptions.paths, {
prefix: "<rootDir>/",
});
module.exports = {
transform: {
"^.+\\.(t|j)sx?$": "ts-jest",
},
collectCoverageFrom: ["src/**/*.{js,jsx,ts,tsx}", "!src/**/*.d.ts"],
testMatch: [
"<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}",
"<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}",
],
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
moduleNameMapper: Object.keys(remappedPaths).reduce((acc, key) => {
if (key === "^(.*)$") {
return acc;
}
acc[key] = remappedPaths[key];
return acc;
}, {}),
};