-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
49 lines (46 loc) · 1.53 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
// eslint-disable-next-line
module.exports = {
// TODO: Remove the snapshotFormat override below and regen snapshots
// This is a remnant from the v29 upgrade
snapshotFormat: {
escapeString: true,
printBasicPrototype: true,
},
collectCoverageFrom: [
'**/*.ts',
'!test/**',
'!migrations/**',
'!src/types/**',
],
coverageReporters: ['clover', 'json', 'lcov', 'text', 'html'],
testEnvironment: 'node',
testRunner: 'jest-circus/runner',
roots: ['<rootDir>/src/', '<rootDir>/test/'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
testRegex: '(/__tests__/.*|\\.(test|spec))\\.[tj]sx?$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
modulePathIgnorePatterns: ['<rootDir>/.*/__mocks__'],
// TODO: Use `ts-jest` and map from tsconfig
// See https://kulshekhar.github.io/ts-jest/user/config/#jest-config-with-helper
// ⚠️ Keep this in sync with package.json and tsconfig.json. ⚠️
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^@api/(.*)$': '<rootDir>/src/api/$1',
'^@test/(.*)$': '<rootDir>/test/$1',
'^@types$': '<rootDir>/src/types',
'^@utils/(.*)$': '<rootDir>/src/utils/$1',
'^@webhooks$': '<rootDir>/src/webhooks',
'^@webhooks/(.*)$': '<rootDir>/src/webhooks/$1',
},
globalSetup: './test/jest.globalSetup.ts',
globalTeardown: './test/jest.globalTeardown.ts',
setupFilesAfterEnv: ['./test/jest.setup.ts'],
globals: {
'ts-jest': {
isolatedModules: true,
tsconfig: './test/jest.tsconfig.json',
},
},
};