Skip to content

Commit c0ccf67

Browse files
committed
Add jest config file
1 parent ad8543f commit c0ccf67

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

jest.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = {
2+
"moduleFileExtensions": [
3+
"js",
4+
"json",
5+
// tell Jest to handle *.vue files
6+
"vue"
7+
],
8+
"transform": {
9+
// process js with babel-jest
10+
"^.+\\.js$": "<rootDir>/node_modules/babel-jest",
11+
// process *.vue files with vue-jest
12+
".*\\.(vue)$": "<rootDir>/node_modules/vue-jest"
13+
},
14+
// support the same @ -> src alias mapping in source code
15+
"moduleNameMapper": {
16+
"^@/(.*)$": "<rootDir>/src/$1",
17+
'../api': '<rootDir>/src/api/__mocks__/fake-api.js'
18+
},
19+
// serializer for snapshots
20+
"snapshotSerializers": [
21+
"<rootDir>/node_modules/jest-serializer-vue"
22+
],
23+
"setupTestFrameworkScriptFile": "<rootDir>/src/jest-setup.js"
24+
25+
}

0 commit comments

Comments
 (0)