forked from stolostron/console-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
66 lines (63 loc) · 1.53 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
/** *****************************************************************************
* Licensed Materials - Property of IBM
* (c) Copyright IBM Corporation 2018, 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
const tapReporter = [
'jest-tap-reporter',
{
logLevel: 'ERROR',
showInternalStackTraces: true,
filePath: 'test-output/jestTestLogs.tap',
},
];
const jestConfig = {
collectCoverage: true,
coverageDirectory: './test-output/coverage',
coverageReporters: [
'json',
'html',
'lcov',
'text',
'text-summary',
],
testResultsProcessor: 'jest-sonar-reporter',
testPathIgnorePatterns: [
'/node_modules/',
],
coverageThreshold: {
global: {
branches: 21,
functions: 28,
lines: 33,
statements: 32,
},
},
collectCoverageFrom: [
'src/**/*.{js,jsx,ts,tsx}',
'!src/**/mocks/*.{js,ts}',
],
testEnvironment: 'node',
setupFilesAfterEnv: [
'./jest.setup.js',
],
moduleFileExtensions: [
'js',
'json',
'jsx',
'node',
'ts',
'tsx',
],
reporters: [
'default',
],
preset: 'ts-jest/presets/js-with-ts',
}
jestConfig.reporters = process.env.TRAVIS ? ['default', tapReporter] : ['default'];
module.exports = jestConfig;