forked from stolostron/application-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
70 lines (67 loc) · 1.98 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/** *****************************************************************************
* Licensed Materials - Property of IBM
* (c) Copyright IBM Corporation 2018, 2019. All Rights Reserved.
*
* US Government Users Restricted Rights - Use, duplication or disclosure
* restricted by GSA ADP Schedule Contract with IBM Corp.
*******************************************************************************/
// Copyright (c) 2020 Red Hat, Inc.
// Copyright Contributors to the Open Cluster Management project
const tapReporter = [
'jest-tap-reporter',
{
logLevel: 'ERROR',
showInternalStackTraces: true,
filePath: 'test-output/jestTestLogs.tap'
}
]
const jestConfig = {
collectCoverage: true,
collectCoverageFrom: [
'src-web/**/*.{js,jsx}',
'!**/src-web/index.js',
'!**/src-web/components/TemplateEditor/**'
],
coverageDirectory: './test-output/coverage',
coverageReporters: [
'json-summary',
'json',
'html',
'lcov',
'text',
'text-summary'
],
testResultsProcessor: 'jest-sonar-reporter',
testURL: 'http://localhost/',
coverageThreshold: {
global: {
branches: 50,
functions: 55,
lines: 60,
statements: 60
}
},
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$'],
globalSetup: '<rootDir>/tests/jest/config/properties-to-json.js',
setupFiles: ['<rootDir>/tests/jest/config/setup.js'],
moduleNameMapper: {
'\\.(css|scss|svg|png)$': '<rootDir>/tests/jest/config/styleMock.js'
}
}
jestConfig.reporters = process.env.TRAVIS
? ['default', tapReporter]
: ['default']
module.exports = jestConfig