forked from microsoft/accessibility-insights-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.base.js
43 lines (43 loc) · 1.57 KB
/
jest.config.base.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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
module.exports = {
clearMocks: true,
collectCoverage: true,
displayName: 'all unit tests',
globals: {
'ts-jest': {
tsConfig: '<rootDir>/tsconfig.json',
},
},
moduleDirectories: ['node_modules'],
moduleFileExtensions: ['ts', 'js', 'json'],
// This ensures that failures in beforeAll/beforeEach result in dependent tests not trying to run.
// See https://github.com/facebook/jest/issues/2713
testRunner: 'jest-circus/runner',
transform: {
'^.+\\.(ts)$': 'ts-jest',
},
testMatch: ['**/*.spec.[tj]s'],
testPathIgnorePatterns: ['/dist/', '/out/'],
verbose: true,
coverageDirectory: '<rootDir>/test-results/unit/coverage',
coverageReporters: ['json', 'lcov', 'text', 'cobertura'],
collectCoverageFrom: [
'<rootDir>/**/*.js',
'<rootDir>/**/*.ts',
'!<rootDir>/dist/**',
'!<rootDir>/out/**',
'!<rootDir>/**/jest.config.js',
'!<rootDir>/**/prettier.config.js',
'!<rootDir>/**/webpack.config.js',
'!<rootDir>/**/node_modules/**',
'!<rootDir>/**/test-results/**',
'!<rootDir>/**/test-utilities/**',
'!<rootDir>/**/dev-scripts/**',
'!<rootDir>/**/jump-consistent-hash.*',
'!<rootDir>/**/guid-generator.*',
],
reporters: ['default', ['jest-junit', { outputDirectory: '<rootDir>/test-results/unit', outputName: 'junit.xml' }]],
testEnvironment: 'node',
setupFilesAfterEnv: ['jest-extended'],
};