-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
60 lines (45 loc) · 1.17 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
const fs = require('fs')
const path = require('path')
const corePackages = fs.readdirSync(path.resolve(__dirname, 'packages'))
module.exports = {
testEnvironment: 'node',
expand: true,
forceExit: true,
roots: [
'<rootDir>/packages',
'<rootDir>/test'
],
// https://github.com/facebook/jest/pull/6747 fix warning here
// But its performance overhead is pretty bad (30+%).
// detectOpenHandles: true
setupFilesAfterEnv: ['./test/utils/setup-env'],
setupFiles: ['./test/utils/setup'],
coverageDirectory: './coverage',
collectCoverageFrom: [
'**/packages/*/src/**/*.js'
],
coveragePathIgnorePatterns: [
'node_modules/(?!(@nuxt|nuxt))',
'packages/webpack/src/config/plugins/vue',
'packages/server/src/jsdom'
],
testPathIgnorePatterns: [
'node_modules/(?!(@nuxt|nuxt))',
'test/fixtures/.*/.*?/',
'examples/.*'
],
transformIgnorePatterns: [
'node_modules/(?!(@nuxt|nuxt))'
],
transform: {
'^.+\\.js$': 'babel-jest',
'^.+\\.vue$': 'vue-jest'
},
moduleFileExtensions: [
'js',
'json'
],
moduleNameMapper: {
[`@nuxt/(${corePackages.join('|')})(/?.*)$`]: '<rootDir>/packages/$1/src/$2'
}
}