generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
33 lines (31 loc) · 1.01 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
import { basename, extname } from 'node:path';
import type { Config } from '@jest/types';
const config: Config.InitialOptions = {
verbose: true,
rootDir: './',
testEnvironment: 'node',
moduleFileExtensions: ['js', 'ts'],
testMatch: ['**/*.test.ts'],
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
transform: {
'^.+\\.ts$': 'ts-jest'
},
collectCoverage: true,
collectCoverageFrom: ['./src/**'],
coverageReporters: ['lcovonly', 'lcov', 'html'],
coverageDirectory: '.qodana/code-coverage/',
reporters: [
'default',
['jest-junit', {
outputDirectory: './test-results',
outputName: 'junit.xml',
classNameTemplate: '{classname}',
titleTemplate: '{title}',
suiteNameTemplate: (arg: { filepath: string }) => {
const name = basename(arg.filepath, extname(arg.filepath));
return basename(name, extname(name));
}
}]
]
};
export default config;