-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
29 lines (28 loc) · 933 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
const fs = require('fs');
const project = require('./project.json');
const env = process.NODE_ENV || 'development';
module.exports = {
collectCoverageFrom: project.tests.source.files,
coverageReporters: ['html'],
coverageThreshold: {
global: {
statements: 100,
branches: 100,
functions: 100,
lines: 100
}
},
moduleNameMapper: {
'@vue$': 'vue/dist/vue.common.js',
'@environment$': `<rootDir>/${project.environments.source.root}/${env}.js`,
'@images\/(.*)$': `${__dirname}/${project.images.source.root}$1`,
'@scripts\/(.*)$': `<rootDir>/${project.scripts.source.root}$1`,
'@styles\/(.*)$': `<rootDir>/${project.styles.source.root}$1`
},
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
transform: {
'^.+\\.(css|styl|png|jpe?g|gif|svg)$': '<rootDir>/src/scripts/base/mocks/raw-files.js',
'^.+\\.js$': 'babel-jest',
'^.+\\.html$': 'html-loader-jest'
}
}