forked from DimensionDev/Maskbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
34 lines (32 loc) · 1.19 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
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/
import type { InitialOptionsTsJest } from 'ts-jest/dist/types'
import { defaultsESM as tsjPreset } from 'ts-jest/presets'
Error.stackTraceLimit = Infinity
const config: InitialOptionsTsJest = {
transform: {
...tsjPreset.transform,
},
globals: {
'ts-jest': {
useESM: true,
isolatedModules: true,
},
},
cacheDirectory: './node_modules/.cache/jest/',
clearMocks: true,
coverageProvider: 'v8',
testMatch: ['**/tests/**/*.[jt]s?(x)'],
modulePathIgnorePatterns: ['dist'],
extensionsToTreatAsEsm: ['.ts', '.tsx'],
moduleNameMapper: {
'@masknet/shared-base': '<rootDir>/packages/shared-base/src/index.ts',
'jest-websocket-mock': '<rootDir>/packages/web3-shared/base/node_modules/jest-websocket-mock',
'reconnecting-websocket': '<rootDir>/packages/web3-shared/base/node_modules/reconnecting-websocket',
'date-fns/(.*)': '<rootDir>/packages/web3-shared/base/node_modules/date-fns/$1',
},
snapshotSerializers: ['@masknet/serializer'],
}
export default config