2019-10-08 19:20:12 +08:00
|
|
|
module.exports = {
|
2022-08-08 16:41:30 +08:00
|
|
|
// "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
|
|
|
|
// }
|
2019-10-08 19:20:12 +08:00
|
|
|
// },
|
2022-08-08 16:41:30 +08:00
|
|
|
globals: {
|
|
|
|
'ts-jest': {
|
|
|
|
// @see https://github.com/kulshekhar/ts-jest/issues/933#issuecomment-479821844
|
|
|
|
babelConfig: require('./babel.config.js'),
|
|
|
|
},
|
|
|
|
},
|
2019-11-20 20:44:08 +08:00
|
|
|
moduleFileExtensions: [ 'ts', 'tsx', 'js' ],
|
2019-11-29 15:38:17 +08:00
|
|
|
modulePathIgnorePatterns: [ 'dist' ],
|
2019-10-08 19:20:12 +08:00
|
|
|
moduleNameMapper: {
|
2020-05-27 16:28:07 +08:00
|
|
|
'@antv/l7-(.+)$': '<rootDir>packages/$1/src'
|
2019-10-08 19:20:12 +08:00
|
|
|
},
|
|
|
|
notify: true,
|
|
|
|
notifyMode: 'always',
|
2019-11-20 20:44:08 +08:00
|
|
|
roots: [ '<rootDir>packages' ],
|
|
|
|
testMatch: [ '**/__tests__/*.spec.+(ts|tsx|js)', '**/*.test.+(ts|tsx|js)', '**/__tests__/*/*.spec.+(ts|tsx|js)' ],
|
2019-10-08 19:20:12 +08:00
|
|
|
transform: {
|
|
|
|
// '^.+\\.(ts|tsx)$': 'ts-jest',
|
|
|
|
// @see https://github.com/kulshekhar/ts-jest/issues/1130
|
2019-11-20 20:44:08 +08:00
|
|
|
'^.+\\.(ts|tsx)$': 'babel-jest'
|
2019-10-08 19:20:12 +08:00
|
|
|
},
|
2019-11-20 20:44:08 +08:00
|
|
|
setupFilesAfterEnv: [ '<rootDir>jest/setupTests.ts' ],
|
2022-08-10 11:11:32 +08:00
|
|
|
snapshotSerializers: [ 'enzyme-to-json/serializer' ],
|
|
|
|
coverageReporters: ["html"],
|
|
|
|
coverageThreshold: {
|
|
|
|
global: {
|
2022-08-18 10:19:12 +08:00
|
|
|
branches: 9,
|
|
|
|
functions: 11.5,
|
|
|
|
lines: 15,
|
|
|
|
statements: 15,
|
2022-08-10 11:11:32 +08:00
|
|
|
},
|
|
|
|
},
|
2019-10-08 19:20:12 +08:00
|
|
|
};
|