-
Notifications
You must be signed in to change notification settings - Fork 2
/
jest.config.ts
32 lines (29 loc) · 925 Bytes
/
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
import * as Fs from 'fs'
import type { InitialOptionsTsJest } from 'ts-jest/dist/types'
import { pathsToModuleNameMapper } from 'ts-jest/utils'
import * as TypeScript from 'typescript'
const tsconfig = TypeScript.readConfigFile('tsconfig.json', (path) =>
Fs.readFileSync(path, { encoding: 'utf-8' })
)
const config: InitialOptionsTsJest = {
preset: 'ts-jest',
moduleNameMapper: pathsToModuleNameMapper(tsconfig.config.compilerOptions.paths, {
prefix: '<rootDir>',
}),
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
'jest-watch-select-projects',
'jest-watch-suspend',
],
globals: {
'ts-jest': {
diagnostics: Boolean(process.env.CI),
// TODO bring back once working... prevents importing nexus etc.?
// astTransformers: {
// before: ['ts-jest/dist/transformers/path-mapping'],
// },
},
},
}
export default config