2018-09-19 19:36:56 +00:00
|
|
|
module.exports = {
|
2021-09-01 20:39:46 +00:00
|
|
|
testEnvironment: 'jsdom',
|
2018-09-19 19:36:56 +00:00
|
|
|
preset: 'ts-jest',
|
2020-07-28 02:58:37 +00:00
|
|
|
setupFilesAfterEnv: ['./scripts/setupJestEnv.ts'],
|
2018-09-19 21:45:19 +00:00
|
|
|
globals: {
|
|
|
|
__DEV__: true,
|
2019-11-04 16:24:22 +00:00
|
|
|
__TEST__: true,
|
2019-12-10 23:24:59 +00:00
|
|
|
__VERSION__: require('./package.json').version,
|
2019-09-17 15:57:25 +00:00
|
|
|
__BROWSER__: false,
|
2020-02-13 23:50:36 +00:00
|
|
|
__GLOBAL__: false,
|
2020-04-20 19:23:26 +00:00
|
|
|
__ESM_BUNDLER__: true,
|
|
|
|
__ESM_BROWSER__: false,
|
2020-01-29 14:49:17 +00:00
|
|
|
__NODE_JS__: true,
|
2020-07-21 01:51:30 +00:00
|
|
|
__FEATURE_OPTIONS_API__: true,
|
2020-10-08 01:46:25 +00:00
|
|
|
__FEATURE_SUSPENSE__: true,
|
2021-04-05 21:09:22 +00:00
|
|
|
__FEATURE_PROD_DEVTOOLS__: false,
|
2021-07-02 12:27:52 +00:00
|
|
|
__COMPAT__: true,
|
|
|
|
'ts-jest': {
|
|
|
|
tsconfig: {
|
2021-08-22 19:33:21 +00:00
|
|
|
target: 'esnext',
|
|
|
|
sourceMap: true
|
2021-07-02 12:27:52 +00:00
|
|
|
}
|
|
|
|
}
|
2018-09-19 21:45:19 +00:00
|
|
|
},
|
2018-09-19 19:36:56 +00:00
|
|
|
coverageDirectory: 'coverage',
|
|
|
|
coverageReporters: ['html', 'lcov', 'text'],
|
2019-10-11 02:02:20 +00:00
|
|
|
collectCoverageFrom: [
|
|
|
|
'packages/*/src/**/*.ts',
|
2019-12-11 14:46:52 +00:00
|
|
|
'!packages/runtime-test/src/utils/**',
|
2019-11-04 23:41:40 +00:00
|
|
|
'!packages/template-explorer/**',
|
2021-03-28 06:20:11 +00:00
|
|
|
'!packages/sfc-playground/**',
|
2020-04-02 01:36:50 +00:00
|
|
|
'!packages/size-check/**',
|
2020-06-11 20:58:11 +00:00
|
|
|
'!packages/runtime-core/src/profiling.ts',
|
2020-10-14 08:23:51 +00:00
|
|
|
'!packages/runtime-core/src/customFormatter.ts',
|
2020-06-11 20:58:11 +00:00
|
|
|
// 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
|
2021-04-30 22:15:36 +00:00
|
|
|
'!packages/vue/src/runtime.ts',
|
|
|
|
// mostly just entries
|
|
|
|
'!packages/vue-compat/**'
|
2019-10-11 02:02:20 +00:00
|
|
|
],
|
2020-02-11 23:40:21 +00:00
|
|
|
watchPathIgnorePatterns: ['/node_modules/', '/dist/', '/.git/'],
|
2019-06-12 07:43:19 +00:00
|
|
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
|
2018-09-19 19:36:56 +00:00
|
|
|
moduleNameMapper: {
|
2021-04-06 16:17:17 +00:00
|
|
|
'@vue/compat': '<rootDir>/packages/vue-compat/src',
|
2020-01-29 23:03:42 +00:00
|
|
|
'^@vue/(.*?)$': '<rootDir>/packages/$1/src',
|
|
|
|
vue: '<rootDir>/packages/vue/src'
|
2018-09-19 19:36:56 +00:00
|
|
|
},
|
|
|
|
rootDir: __dirname,
|
2019-12-23 15:51:28 +00:00
|
|
|
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-19 19:36:56 +00:00
|
|
|
}
|