-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
33 lines (30 loc) · 911 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
33
import type { Config } from '@jest/types'
import { pathsToModuleNameMapper } from 'ts-jest/utils'
import { compilerOptions } from './tsconfig.json'
const config: { projects: Config.InitialOptions[] } = {
projects: [
{
testPathIgnorePatterns: ['<rootDir>/server'],
transform: {
'^.+\\.tsx$': 'babel-jest',
'^.+\\.ts$': 'ts-jest'
},
moduleNameMapper: {
'\\.(css|less|sass|scss)$': 'identity-obj-proxy',
'\\.(gif|ttf|eot|svg|png)$': '<rootDir>/test/__mocks__/fileMock.js',
...pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>/'
})
}
},
{
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['<rootDir>/server/test/**/*.ts'],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>/'
})
}
]
}
export default config