-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
26 lines (25 loc) · 1 KB
/
jest.config.js
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
const { pathsToModuleNameMapper } = require("ts-jest/utils");
const { compilerOptions } = require("./tsconfig");
const filesExts = require("./config/filesExts");
module.exports = {
preset: "ts-jest",
errorOnDeprecated: true,
coverageReporters: ["json-summary", "text", "html"],
testMatch: ["**/__tests__/**/*.ts?(x)", "**/?(*.)+(spec).ts?(x)"],
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json"],
collectCoverageFrom: ["src/**/*.ts?(x)", "!src/**/*.stories.ts?(x)"],
modulePaths: ["<rootDir>/"],
setupFilesAfterEnv: ["<rootDir>/__utils__/setupFramework.ts"],
setupFiles: ["jest-date-mock", "<rootDir>/__utils__/setupTests.ts"],
moduleNameMapper: {
// https://jestjs.io/docs/en/webpack#handling-static-assets
"\\.md$": "<rootDir>/__mocks__/mdMock.js",
[`\\.(${filesExts.join("|")})$`]: "<rootDir>/__mocks__/fileMock.js",
...pathsToModuleNameMapper(compilerOptions.paths || {}, {
prefix: "<rootDir>/",
}),
},
globals: {
"ts-jest": { isolatedModules: true },
},
};