|
1 | | -module.exports = { |
2 | | - moduleDirectories: ['node_modules', 'src'], |
| 1 | +const merge = require('lodash.merge') |
| 2 | +const config = require('kcd-scripts/jest') |
| 3 | + |
| 4 | +module.exports = merge(config, { |
| 5 | + testEnvironment: 'jsdom', |
3 | 6 | moduleFileExtensions: ['js', 'vue'], |
4 | 7 | moduleNameMapper: { |
5 | | - '@testing-library/vue': '<rootDir>/src/vue-testing-library.js' |
| 8 | + '@testing-library/vue': '<rootDir>/src/vue-testing-library.js', |
6 | 9 | }, |
7 | 10 | coverageDirectory: './coverage', |
8 | | - collectCoverageFrom: [ |
9 | | - '**/src/**/*.js', |
10 | | - '!**/tests/__tests__/**', |
11 | | - '!**/node_modules/**' |
12 | | - ], |
13 | | - testPathIgnorePatterns: [ |
14 | | - '/node_modules/', |
15 | | - '<rootDir>/dist/', |
16 | | - '<rootDir>/tests/__tests__/components/' |
17 | | - ], |
| 11 | + collectCoverageFrom: ['**/src/**/*.js', '!**/src/__tests__/**'], |
18 | 12 | transform: { |
19 | 13 | '^.+\\.js$': '<rootDir>/node_modules/babel-jest', |
20 | | - '.*\\.(vue)$': '<rootDir>/node_modules/vue-jest' |
| 14 | + '.*\\.(vue)$': '<rootDir>/node_modules/vue-jest', |
21 | 15 | }, |
22 | | - snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'] |
23 | | -} |
| 16 | + snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'], |
| 17 | + testPathIgnorePatterns: [ |
| 18 | + '<rootDir>/node_modules', |
| 19 | + '<rootDir>/src/__tests__/components', |
| 20 | + ], |
| 21 | +}) |
0 commit comments