This repository was archived by the owner on Dec 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.base.js
More file actions
64 lines (63 loc) · 1.69 KB
/
jest.config.base.js
File metadata and controls
64 lines (63 loc) · 1.69 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const { defaults } = require("jest-config");
module.exports = {
"verbose": true,
testEnvironment: "jsdom",
setupFiles: [
// needed for UI to mock canvas load
// "jest-canvas-mock"
],
preset: "ts-jest",
testMatch: null,
testRegex: ".*test*\\.(ts|tsx|js)$",
testPathIgnorePatterns: [
"/node_modules/",
"/dist/"
],
transform: {
"\\.(gql|graphql)$": "jest-transform-graphql",
"\\.(graphqls)$": "jest-raw-loader",
"\\.(ts|tsx)$": "ts-jest",
// Use our custom transformer only for the *.js and *.jsx files
"\\.(js|jsx)?$": "./transform.js",
// future need to test with
// "^.+\\.(js|jsx|ts|tsx)$": "./transform.js",
".+\\.(css|styl|less|sass|scss)$": "jest-css-modules-transform"
},
roots: [
"packages",
"packages-modules",
"servers"
],
moduleFileExtensions: [
"tsx",
"ts",
...defaults.moduleFileExtensions,
"js",
"jsx",
"json",
"gql",
"graphql"],
moduleNameMapper: {
'^__mocks__/(.*)$': '<rootDir>/../../__mocks__/$1',
// we'll use commonjs version of lodash for tests 👌
// because we don't need to use any kind of tree shaking right?!
'^lodash-es$': '<rootDir>/node_modules/lodash/index.js'
},
transformIgnorePatterns: [
"/node_modules/(?!(babel-runtime|antd)).*/",
"<rootDir>/node_modules/(?!lodash-es/.*)"
],
clearMocks: true,
globals: {
__BACKEND_URL__: 'http://localhost:3010',
__GRAPHQL_URL__: 'http://localhost:8085/graphql',
"ts-jest": {
// tsConfig: "<rootDir>/src/__tests__/tsconfig.json",
// https://github.com/kulshekhar/ts-jest/issues/766
"diagnostics": {
"warnOnly": true
},
// "skipBabel": true
}
}
};