forked from reach/reach-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
39 lines (38 loc) · 1.19 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
module.exports = {
collectCoverageFrom: ["packages/**/src/**/*.{ts,tsx,js}"],
globals: {
__DEV__: "boolean",
},
transform: {
".(ts|tsx)$": require.resolve("ts-jest/dist"),
".(js|jsx)$": require.resolve("babel-jest"), // jest's default
},
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
moduleNameMapper: {
"\\$test(.*)$": "<rootDir>/test/$1",
},
setupFilesAfterEnv: ["<rootDir>/test/setupTests.ts"],
timers: "modern",
testEnvironment: "jsdom",
testMatch: ["<rootDir>/**/*.(spec|test).{ts,tsx,js,jsx}"],
testURL: "http://localhost",
transformIgnorePatterns: [
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$",
"^.+\\.js$",
],
// projects: ["<rootDir>", "<rootDir>/packages/*"],
// rootDir,
watchPlugins: [
require.resolve("jest-watch-typeahead/filename"),
require.resolve("jest-watch-typeahead/testname"),
],
};
if (process.env.USE_REACT_16 === "true") {
module.exports.cacheDirectory = ".cache/jest-cache-react-16";
module.exports.moduleNameMapper = {
...module.exports.moduleNameMapper,
"^react-is((\\/.*)?)$": "react-is-16$1",
"^react-dom((\\/.*)?)$": "react-dom-16$1",
"^react((\\/.*)?)$": "react-16$1",
};
}