forked from stolostron/grc-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
71 lines (66 loc) · 1.92 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
71
/*******************************************************************************
* Licensed Materials - Property of IBM
* (c) Copyright IBM Corporation 2019. All Rights Reserved.
*
* Note to U.S. 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 */
process.env.TZ = 'UTC'
const tapReporter = [
'jest-tap-reporter',
{
logLevel: 'ERROR',
showInternalStackTraces: true,
filePath: 'test-output/unit/jestTestLogs.tap'
}
]
const jestConfig = {
collectCoverage: true,
collectCoverageFrom: [
'src-web/**/*.{js,jsx}'
],
coverageDirectory: './test-output/unit/coverage',
coverageReporters: [
'json-summary',
'json',
'html',
'lcov',
'text',
'text-summary'
],
testResultsProcessor: 'jest-sonar-reporter',
testURL: 'http://localhost/',
testEnvironment: 'jsdom',
coverageThreshold: {
global: {
branches: 51,
functions: 51,
lines: 55,
statements: 55,
},
},
testMatch: [
'<rootDir>/tests/jest/*/*.test.js?(x)',
'<rootDir>/tests/jest/*/*/*.test.js?(x)',
'<rootDir>/tests/jest/*/*/*/*.test.js?(x)',
],
transform: {
'^.+\\.js$': 'babel-jest',
'.+\\.(hbs)$': 'jest-handlebars',
'.+\\.(handlebars)$': 'jest-handlebars',
'.+\\.(yaml)$': 'jest-yaml-transform',
},
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',
'monaco-editor': '<rootDir>/node_modules/react-monaco-editor'
}
}
jestConfig.reporters = process.env.TRAVIS ? [ 'default', tapReporter ] : [ 'default']
module.exports = jestConfig