-
Notifications
You must be signed in to change notification settings - Fork 82
/
Copy pathjest.config.js
41 lines (38 loc) · 1.11 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const glob = require("glob");
// Return directories within the given path.
const dirs = (path) => (path ? glob.sync(`${path}/*/`) : []);
/**
* List of root (test path) directories
*
* Jest will only search for tests and load manual mocks
* (e.g. `src/__mocks__/fs.js`) within these directories.
*/
const roots = ["./src", "./tests"].concat(
dirs("./plugins"),
dirs("./packages")
);
module.exports = {
verbose: true,
testURL: "http://localhost/",
globals: {
"ts-jest": {
useBabelrc: true,
},
},
roots,
transform: {
"^.+\\.jsx?$": "ts-jest",
"^.+\\.tsx?$": "ts-jest",
},
setupFilesAfterEnv: ["./jest/setupTestFramework.ts"],
setupFiles: ["./jest/setupEnv.ts"],
testRegex: "/__tests__/.*\\-test\\.(jsx?|tsx?)$",
moduleFileExtensions: ["js", "jsx", "json", "ts", "tsx"],
modulePathIgnorePatterns: ["/tmp/", "/node_modules/", "/.module-cache/"],
moduleNameMapper: {
"\\.(jpe?g|png|gif|bmp|svg|less|raml)$": "<rootDir>/jest/fileMock.ts",
},
timers: "fake",
coverageReporters: ["json", "lcov", "cobertura", "text"],
testPathIgnorePatterns: ["/tmp/", "/node_modules/"],
};