Skip to content

Instantly share code, notes, and snippets.

@agm1984
Last active July 10, 2020 06:24
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 agm1984/3219d6905e3ccd077f55cb2494c5b842 to your computer and use it in GitHub Desktop.
Save agm1984/3219d6905e3ccd077f55cb2494c5b842 to your computer and use it in GitHub Desktop.
Demonstration of `.jest.config.js` for `vue-jest` and `jest`
module.exports = {
testRegex: 'resources/js/.*.spec.js$',
moduleFileExtensions: [
'js',
'json',
'vue',
],
transform: {
'^.+\\.vue$': 'vue-jest',
'^.+\\.js$': 'babel-jest',
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/resources/$1',
'^~/(.*)$': '<rootDir>/resources/js/$1',
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment