-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
65 lines (65 loc) · 1.86 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
module.exports = {
// "preset": "jest-puppeteer",
// "globalSetup": "jest-environment-puppeteer/setup",
// "globalTeardown": "jest-environment-puppeteer/teardown",
// "testEnvironment": "jest-environment-puppeteer",
// runner: 'jest-electron/runner',
// testEnvironment: 'jest-electron/environment',
// preset: 'ts-jest',
// clearMocks: true,
// collectCoverageFrom: [
// 'packages/**/*.{ts,tsx}',
// '!**/node_modules/**',
// '!**/__tests__/**',
// '!**/*.d.ts'
// ],
// coverageDirectory: 'coverage',
// coverageReporters: [ 'text', 'clover' ],
// coverageThreshold: {
// global: {
// branches: 80,
// functions: 80,
// lines: 80,
// statements: 80
// }
// },
globals: {
'ts-jest': {
// @see https://github.com/kulshekhar/ts-jest/issues/933#issuecomment-479821844
babelConfig: require('./babel.config.js'),
},
},
moduleFileExtensions: ['ts', 'tsx', 'js'],
modulePathIgnorePatterns: ['dist'],
moduleNameMapper: {
'@antv/l7-(.+)$': '<rootDir>packages/$1/src',
},
notify: true,
notifyMode: 'always',
roots: ['<rootDir>packages'],
testMatch: [
'**/__tests__/*.spec.+(ts|tsx|js)',
'**/*.test.+(ts|tsx|js)',
'**/__tests__/*/*.spec.+(ts|tsx|js)',
],
transform: {
// '^.+\\.(ts|tsx)$': 'ts-jest',
// @see https://github.com/kulshekhar/ts-jest/issues/1130
'^.+\\.(ts|tsx)$': 'babel-jest',
screenfull: 'babel-jest',
'\\.(less|css)$': 'jest-less-loader',
'\\.png$': 'jest-file-loader',
},
setupFilesAfterEnv: [ '<rootDir>jest/setupTests.ts' ],
snapshotSerializers: [ 'enzyme-to-json/serializer' ],
coverageReporters: ['html', 'lcov', 'clover'],
coveragePathIgnorePatterns: ['/node_modules/', '/iconfont/'],
coverageThreshold: {
global: {
branches: 9,
functions: 11.5,
lines: 15,
statements: 15,
},
},
};