-
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathjest.config.ts
More file actions
29 lines (27 loc) · 708 Bytes
/
jest.config.ts
File metadata and controls
29 lines (27 loc) · 708 Bytes
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
import type { JestConfigWithTsJest } from 'ts-jest'
const config: JestConfigWithTsJest = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/test/**/*.spec.ts'],
collectCoverageFrom: [
'<rootDir>/src/**/*.ts',
'!<rootDir>/src/types/**/*.ts',
],
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
// '^.+\\.[tj]sx?$' to process ts,js,tsx,jsx with `ts-jest`
// '^.+\\.m?[tj]sx?$' to process ts,js,tsx,jsx,mts,mjs,mtsx,mjsx with `ts-jest`
'^.+\\.tsx?$': [
'ts-jest',
{
useESM: true,
diagnostics: false,
isolatedModules: true,
},
],
},
};
export default config;