forked from sharoncraddock/vite-react-typescript-jest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
29 lines (28 loc) · 826 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
export default {
preset: 'ts-jest/presets/js-with-ts',
testEnvironment: "jsdom",
transform: {
'^.+\\.tsx?$': ['ts-jest', {
diagnostics: {
ignoreCodes: [1343]
},
astTransformers: {
before: [
{
path: 'ts-jest-mock-import-meta', // or, alternatively, 'ts-jest-mock-import-meta' directly, without node_modules.
options: { metaObjectReplacement: { url: 'https://www.url.com' } }
}
]
}
}],
'^.+\\.jsx?$': 'babel-jest', // 추가
"node_modules/@o2pluss+\\.(j|t)sx?$": "ts-jest"
},
transformIgnorePatterns: [
'<rootDir>/node_modules/(?!@o2pluss)/',
],
moduleNameMapper: {
'\\.(gif|ttf|eot|svg|png)$': '<rootDir>/test/__mocks__/fileMock.ts',
'\\.(css|less|sass|scss)$': 'identity-obj-proxy',
},
}