@@ -11,32 +11,35 @@ module.exports = (api, _, __, invoking) => {
11
11
'@vue/test-utils' : '1.0.0-beta.29'
12
12
} ,
13
13
jest : {
14
- ' moduleFileExtensions' : [
14
+ moduleFileExtensions : [
15
15
'js' ,
16
16
'jsx' ,
17
17
'json' ,
18
18
// tell Jest to handle *.vue files
19
19
'vue'
20
20
] ,
21
- ' transform' : {
21
+ transform : {
22
22
// process *.vue files with vue-jest
23
23
'^.+\\.vue$' : 'vue-jest' ,
24
- '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$' : 'jest-transform-stub'
24
+ '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$' :
25
+ 'jest-transform-stub'
25
26
} ,
26
27
'transformIgnorePatterns' : [ '/node_modules/' ] ,
27
28
// support the same @ -> src alias mapping in source code
28
- ' moduleNameMapper' : {
29
+ moduleNameMapper : {
29
30
'^@/(.*)$' : '<rootDir>/src/$1'
30
31
} ,
31
32
// serializer for snapshots
32
- 'snapshotSerializers' : [
33
- 'jest-serializer-vue'
34
- ] ,
35
- 'testMatch' : [
33
+ snapshotSerializers : [ 'jest-serializer-vue' ] ,
34
+ testMatch : [
36
35
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
37
36
] ,
38
37
// https://github.com/facebook/jest/issues/6766
39
- 'testURL' : 'http://localhost/'
38
+ testURL : 'http://localhost/' ,
39
+ watchPlugins : [
40
+ require . resolve ( 'jest-watch-typeahead/filename' ) ,
41
+ require . resolve ( 'jest-watch-typeahead/testname' )
42
+ ]
40
43
}
41
44
} )
42
45
@@ -60,9 +63,13 @@ module.exports = (api, _, __, invoking) => {
60
63
// Jest's shipped babel-jest still uses babel 6,
61
64
// so we cannot use extendPackage which renders babel.config.js.
62
65
api . render ( files => {
63
- files [ '.babelrc' ] = JSON . stringify ( {
64
- plugins : [ 'transform-es2015-modules-commonjs' ]
65
- } , null , 2 )
66
+ files [ '.babelrc' ] = JSON . stringify (
67
+ {
68
+ plugins : [ 'transform-es2015-modules-commonjs' ]
69
+ } ,
70
+ null ,
71
+ 2
72
+ )
66
73
} )
67
74
}
68
75
} else {
@@ -74,7 +81,7 @@ module.exports = (api, _, __, invoking) => {
74
81
}
75
82
}
76
83
77
- const applyTS = module . exports . applyTS = ( api , invoking ) => {
84
+ const applyTS = ( module . exports . applyTS = ( api , invoking ) => {
78
85
api . extendPackage ( {
79
86
jest : {
80
87
moduleFileExtensions : [ 'ts' , 'tsx' ] ,
@@ -119,12 +126,12 @@ const applyTS = module.exports.applyTS = (api, invoking) => {
119
126
}
120
127
} )
121
128
}
122
- }
129
+ } )
123
130
124
- const applyESLint = module . exports . applyESLint = api => {
131
+ const applyESLint = ( module . exports . applyESLint = api => {
125
132
api . render ( files => {
126
133
files [ 'tests/unit/.eslintrc.js' ] = api . genJSConfig ( {
127
134
env : { jest : true }
128
135
} )
129
136
} )
130
- }
137
+ } )
0 commit comments