Last active
May 17, 2019 15:23
-
-
Save agcty/0dbbba5b625c5e49dc1ff7e98470d29d to your computer and use it in GitHub Desktop.
Jest config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
// tell Jest to handle `*.vue` files | |
moduleFileExtensions: ["js", "json", "vue"], | |
watchman: false, | |
moduleNameMapper: { | |
"^~/(.*)$": "<rootDir>/$1", | |
"^~~/(.*)$": "<rootDir>/$1", | |
"^@/(.*)$": "<rootDir>/$1" | |
}, | |
transform: { | |
// process js with `babel-jest` | |
"^.+\\.js$": "<rootDir>/node_modules/babel-jest", | |
// process `*.vue` files with `vue-jest` | |
".*\\.(vue)$": "<rootDir>/node_modules/vue-jest" | |
}, | |
snapshotSerializers: ["<rootDir>/node_modules/jest-serializer-vue"], | |
collectCoverage: true, | |
collectCoverageFrom: [ | |
"<rootDir>/components/**/*.vue", | |
"<rootDir>/pages/*.vue" | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment