-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjest.config.js
40 lines (39 loc) · 1018 Bytes
/
jest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
process.env.VUE_CLI_BABEL_TARGET_NODE = true;
process.env.VUE_CLI_BABEL_TRANSPILE_MODULES = true;
module.exports = {
// collectCoverage: true,
// collectCoverageFrom: [
// '**/*.{js, vue}',
// '!**/node_modules/**'
// ],
roots: [
'<rootDir>/src',
'<rootDir>/',
],
moduleFileExtensions: [
'js', 'vue', 'json'
],
moduleDirectories: [
'node_modules'
],
moduleNameMapper: {
'^@/(.*)$': "<rootDir>/src/$1"
},
setupFiles: [
'<rootDir>/src/tests/setup.js'
],
testMatch: [
'**/__tests__/*.test.js',
'**/vueshots.test.js',
'**/*.stories.js'
],
transform: {
'^.*\\.vue$': "vue-jest",
'^.+\\.stories\\.jsx?$': '<rootDir>/.storybook/injectFileName.js',
'^.+\\.js$': "<rootDir>/node_modules/babel-jest",
'.*\\.(vue)$': '<rootDir>/node_modules/jest-vue-preprocessor',
'.+\\.(css|styl|less|sass|scss)$': 'jest-transform-css',
},
transformIgnorePatterns: ['<rootDir>/node_modules'],
snapshotSerializers: ["jest-serializer-html"]
}