-
Notifications
You must be signed in to change notification settings - Fork 3
/
jest.config.ts
43 lines (40 loc) · 1.26 KB
/
jest.config.ts
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) 2024, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: MIT
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
*/
import type { Config } from 'jest';
const config: Config = {
displayName: 'Unit Tests',
setupFilesAfterEnv: ['jest-extended', 'jest-chain'],
preset: 'ts-jest',
testMatch: ['<rootDir>/test/**/*.ts'],
moduleFileExtensions: ['ts', 'js', 'json'],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.json'
}
},
testResultsProcessor: 'jest-sonar-reporter',
testPathIgnorePatterns: ['/node_modules/', '<rootDir>/lib/', '<rootDir>/test/shared.ts'],
moduleDirectories: ['node_modules'],
collectCoverage: true,
collectCoverageFrom: ['src/**/*.ts', '!src/index.ts', '!src/configs/*.ts'],
coverageDirectory: 'reports/coverage',
moduleNameMapper: {
'^@graphql-eslint/eslint-plugin/(.*)$':
'<rootDir>/node_modules/@graphql-eslint/eslint-plugin/$1'
},
reporters: [
'default',
[
'jest-junit',
{
suiteName: 'Unit Tests',
output: './reports/junit/jest-results.xml'
}
]
]
};
export default config;