forked from stolostron/temptifly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
40 lines (38 loc) · 1.3 KB
/
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
const jestConfig = {
collectCoverage: true,
collectCoverageFrom: ['src/**/*.{js,jsx}', '!**/src/index.js', '!**/src/TemplateEditor/**'],
coverageDirectory: './test-output/coverage',
coverageReporters: ['json-summary', 'json', 'html', 'lcov', 'text', 'text-summary'],
testResultsProcessor: 'jest-sonar-reporter',
testURL: 'http://localhost/',
coverageThreshold: {
// TODO - increase threshold once repo is finalized
global: {
branches: 20,
functions: 30,
lines: 30,
statements: 30,
},
},
testMatch: [
'<rootDir>/tests/jest/**/*.test.js?(x)',
'<rootDir>/tests/jest/**/**/*.test.js?(x)',
'<rootDir>/tests/jest/**/**/**/*.test.js?(x)',
'**/tests/jest/**/*.test.js',
'**/src-web/**/*.test.js',
],
transform: {
'^.+\\.js$': 'babel-jest',
'.+\\.(hbs)$': 'jest-handlebars',
'.+\\.(handlebars)$': 'jest-handlebars',
'.+\\.(yaml)$': 'jest-yaml-transform',
},
transformIgnorePatterns: ['/node_modules/(?!monaco-editor).+\\.js$'],
setupFiles: ['<rootDir>/tests/jest/config/setup.js'],
moduleNameMapper: {
'\\.(css|svg)$': '<rootDir>/tests/jest/config/styleMock.js',
'monaco-editor': '<rootDir>/node_modules/react-monaco-editor',
},
}
jestConfig.reporters = process.env.TRAVIS ? ['default'] : ['default']
module.exports = jestConfig