vue3-yuanma/jest.config.js

45 lines
1.5 KiB
JavaScript
Raw Normal View History

2018-09-20 03:36:56 +08:00
module.exports = {
preset: 'ts-jest',
2020-07-28 10:58:37 +08:00
setupFilesAfterEnv: ['./scripts/setupJestEnv.ts'],
2018-09-20 05:45:19 +08:00
globals: {
__DEV__: true,
2019-11-05 00:24:22 +08:00
__TEST__: true,
2019-12-11 07:24:59 +08:00
__VERSION__: require('./package.json').version,
__BROWSER__: false,
__GLOBAL__: false,
__ESM_BUNDLER__: true,
__ESM_BROWSER__: false,
__NODE_JS__: true,
__FEATURE_OPTIONS_API__: true,
2019-09-10 04:28:32 +08:00
__FEATURE_SUSPENSE__: true
2018-09-20 05:45:19 +08:00
},
2018-09-20 03:36:56 +08:00
coverageDirectory: 'coverage',
coverageReporters: ['html', 'lcov', 'text'],
collectCoverageFrom: [
'packages/*/src/**/*.ts',
2019-12-11 22:46:52 +08:00
'!packages/runtime-test/src/utils/**',
2019-11-05 07:41:40 +08:00
'!packages/template-explorer/**',
'!packages/size-check/**',
'!packages/runtime-core/src/profiling.ts',
// DOM transitions are tested via e2e so no coverage is collected
'!packages/runtime-dom/src/components/Transition*',
// only called in browsers
'!packages/vue/src/devCheck.ts',
// only used as a build entry
'!packages/vue/src/runtime.ts'
],
2020-02-12 07:40:21 +08:00
watchPathIgnorePatterns: ['/node_modules/', '/dist/', '/.git/'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
2018-09-20 03:36:56 +08:00
moduleNameMapper: {
2020-01-30 07:03:42 +08:00
'^@vue/(.*?)$': '<rootDir>/packages/$1/src',
vue: '<rootDir>/packages/vue/src'
2018-09-20 03:36:56 +08:00
},
rootDir: __dirname,
testMatch: ['<rootDir>/packages/**/__tests__/**/*spec.[jt]s?(x)'],
testPathIgnorePatterns: process.env.SKIP_E2E
? // ignore example tests on netlify builds since they don't contribute
// to coverage and can cause netlify builds to fail
['/node_modules/', '/examples/__tests__']
: ['/node_modules/']
2018-09-20 03:36:56 +08:00
}