antv-l7/jest.config.js

45 lines
1.3 KiB
JavaScript
Raw Normal View History

module.exports = {
runner: 'jest-electron/runner',
testEnvironment: 'jest-electron/environment',
preset: 'ts-jest',
clearMocks: true,
2019-11-01 17:15:20 +08:00
collectCoverageFrom: [
'packages/**/*.{ts,tsx}',
'!**/node_modules/**',
'!**/__tests__/**',
'!**/*.d.ts'
],
coverageDirectory: 'coverage',
2019-11-20 20:44:08 +08:00
coverageReporters: [ 'text', 'clover' ],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
2019-11-20 20:44:08 +08:00
statements: 80
}
},
// 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' ],
modulePathIgnorePatterns: [ 'dist' ],
moduleNameMapper: {
'@antv/l7-(.+)$': '<rootDir>packages/$1/src'
},
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)' ],
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-11-20 20:44:08 +08:00
setupFilesAfterEnv: [ '<rootDir>jest/setupTests.ts' ],
snapshotSerializers: [ 'enzyme-to-json/serializer' ]
};