Skip to content

Instantly share code, notes, and snippets.

@davidtorroija
Created February 15, 2022 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidtorroija/4e2fd90cf7f2d315847bedd5cc821592 to your computer and use it in GitHub Desktop.
Save davidtorroija/4e2fd90cf7f2d315847bedd5cc821592 to your computer and use it in GitHub Desktop.
jest config
module.exports = {
moduleFileExtensions: [
"js",
"json",
// tell Jest to handle `*.vue` files
"vue",
],
transform: {
// process `*.vue` files with `vue-jest`
"^.+\\.vue$": "vue-jest",
"^.+\\.js$": "babel-jest",
},
moduleNameMapper: {
"^src(.*)$": "<rootDir>/src$1",
"^~src(.*)$": "<rootDir>/src$1",
"^<src>(.*)$": "<rootDir>/src$1",
"^lodash-es$": "lodash",
},
collectCoverage: true,
collectCoverageFrom: [
"**/src/**/*.{js,vue}",
"!**/dist/**/*.{js,vue}",
"!**/build/**/*.{js,vue}",
"!**/src/app/**/*.{js,vue}",
"!**/node_modules/**",
"!**/src/videojs-utils/**",
"!**/src/config/**",
],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment