generated from ministryofjustice/hmpps-template-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
50 lines (48 loc) · 1.11 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
44
45
46
47
48
49
50
import type { Config } from 'jest'
const config: Config = {
collectCoverage: true,
collectCoverageFrom: [
'server/**/*.{ts,js,jsx,mjs}',
'!server/authentication/*.ts',
'!server/middleware/*.ts',
'!server/routes/*.ts',
'!server/testutils/factories/*.ts',
],
coverageDirectory: 'test_results/unit/coverage',
coverageThreshold: {
global: {
functions: 100,
},
},
moduleFileExtensions: ['web.js', 'js', 'json', 'node', 'ts'],
reporters: [
'default',
[
'jest-junit',
{
outputFile: 'test_results/unit/xml/results-for-ci-report.xml',
},
],
[
'./node_modules/jest-html-reporter',
{
includeFailureMsg: true,
outputPath: 'test_results/unit/results.html',
pageTitle: 'HMPPS Accredited Programmes - Unit Test Report',
sort: 'status',
},
],
],
showSeed: true,
testEnvironment: 'node',
testMatch: ['<rootDir>/(server|job)/**/?(*.)(cy|test).{ts,js,jsx,mjs}'],
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
isolatedModules: true,
},
],
},
}
export default config