forked from artsy/force
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
43 lines (42 loc) · 1.29 KB
/
Copy pathjest.config.js
File metadata and controls
43 lines (42 loc) · 1.29 KB
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
42
43
const sharedConfig = {
transform: {
"\\.(gql|graphql)$": "jest-transform-graphql",
"^.+\\.coffee$": "<rootDir>/node_modules/jest-coffee-preprocessor/index.js",
".(ts|tsx|js|jsx)": "babel-jest",
},
cacheDirectory: ".cache/jest",
coverageDirectory: "./coverage/",
collectCoverage: true,
coverageReporters: ["lcov", "text-summary"],
reporters: ["default", "jest-junit"],
moduleFileExtensions: ["coffee", "js", "json", "jsx", "ts", "tsx"],
}
module.exports = {
projects: [
/**
* Config for wider force, excluding src/v2 directory
*/
{
...sharedConfig,
displayName: "v1",
testPathIgnorePatterns: ["<rootDir>/src/v2"],
testRegex: ".*\\.jest\\.(ts|tsx|js|jsx)$",
setupFiles: ["<rootDir>/test.config.js"],
roots: ["<rootDir>/src"],
testURL: "https://artsy.net",
},
// Config for src/v2 (former Reaction code)
{
...sharedConfig,
displayName: "v2",
testMatch: ["**/src/v2/**/*.jest.(ts|tsx)"],
moduleDirectories: ["node_modules", "<rootDir>/src/v2"],
setupFilesAfterEnv: ["<rootDir>/src/v2/jest.envSetup.ts"],
testURL: "http://localhost",
moduleNameMapper: {
"^luxon$": "<rootDir>/node_modules/luxon",
"^react$": "<rootDir>/node_modules/react",
},
},
],
}