Skip to content

Commit f9c3914

Browse files
meteorlxyulivz
authored andcommitted
chore: set rootDir in jest config (#528)
1 parent 777c4f1 commit f9c3914

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/jest.config.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
// https://github.com/facebook/jest/tree/master/packages/babel-jest
22
// TODO remove 'babel-core@^7.0.0-0' when babel-jest can work with '@babel/core'
33

4+
const path = require('path')
5+
46
module.exports = {
7+
rootDir: path.resolve(__dirname, '..'),
58
verbose: true,
69
moduleFileExtensions: [
710
'js',
811
'vue'
912
],
1013
moduleNameMapper: {
11-
'^@/(.*)$': '<rootDir>/../lib/$1'
14+
'^@/(.*)$': '<rootDir>/lib/$1'
1215
},
1316
transform: {
14-
'^.+\\.js$': '<rootDir>/../node_modules/babel-jest',
15-
'.*\\.(vue)$': '<rootDir>/../node_modules/vue-jest'
17+
'^.+\\.js$': '<rootDir>/node_modules/babel-jest',
18+
'.*\\.(vue)$': '<rootDir>/node_modules/vue-jest'
1619
},
1720
snapshotSerializers: [
18-
'<rootDir>/../node_modules/jest-serializer-vue'
21+
'<rootDir>/node_modules/jest-serializer-vue'
1922
]
2023
}

0 commit comments

Comments
 (0)