-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathjest.config.ts
More file actions
55 lines (51 loc) · 1.32 KB
/
jest.config.ts
File metadata and controls
55 lines (51 loc) · 1.32 KB
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
import { createDefaultEsmPreset, type JestConfigWithTsJest } from 'ts-jest'
const presetConfig = createDefaultEsmPreset()
const jestConfig: JestConfigWithTsJest = {
...presetConfig,
testMatch: [
'**/__tests__/**/*.test.ts',
],
setupFilesAfterEnv: ['jest-extended/all'],
collectCoverageFrom: ['src/**/*.ts'],
coveragePathIgnorePatterns: [
'/node_modules/',
'/__tests__/',
'/src/run.ts',
'/src/index.ts',
'/src/commands/index.ts',
'/src/lib/command/util/st-client-wrapper.ts',
'/src/lib/colors.ts',
],
modulePathIgnorePatterns: [
'<rootDir>/dist',
],
clearMocks: true,
reporters: [
'default',
'github-actions',
['jest-html-reporters', { darkTheme: true }],
],
extensionsToTreatAsEsm: ['.ts'],
// moduleNameMapper and transform are for ES module support.
// See https://kulshekhar.github.io/ts-jest/docs/guides/esm-support
moduleNameMapper: {
// eslint-disable-next-line @typescript-eslint/naming-convention
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest`
// '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest`
// eslint-disable-next-line @typescript-eslint/naming-convention
'^.+\\.tsx?$': [
'ts-jest',
{
useESM: true,
},
],
},
testPathIgnorePatterns: [
'/node_modules/',
'./packages',
],
}
export default jestConfig