-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
37 lines (35 loc) Β· 1.09 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
import type { Config } from 'jest';
const config: Config = {
preset: 'ts-jest',
extensionsToTreatAsEsm: ['.ts', '.tsx'],
globals: {
'ts-jest': {
useESM: true,
},
},
transform: {
'^.+\\.(ts|tsx|js|jsx|mjs)$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.test.json',
},
],
'^.+\\.svg$': 'jest-transformer-svg',
'^.+\\.css$': 'jest-transform-stub',
'^.+\\.[tj]sx?$': 'babel-jest', // .js, .ts, .jsx νμΌμ λν΄ babel-jest μ¬μ©
},
transformIgnorePatterns: [
'node_modules/(?!(swiper|ssr-window|dom7)/)', // λ³νμ 무μνμ§ μλλ‘ μ€μ
],
moduleNameMapper: {
'^swiper/css$': 'identity-obj-proxy',
'^swiper/css/(.*)$': 'identity-obj-proxy',
'^@/(.*)$': '<rootDir>/src/$1',
'\\.svg$': '<rootDir>/__mocks__/fileMock.js', // SVG λͺ¨νΉ μ€μ
'\\.css$': 'identity-obj-proxy', // CSS νμΌμ μ²λ¦¬ν λ°©λ²μ μ€μ
'\\.(jpg|jpeg|png|gif|webp|svg|ico)$': '<rootDir>/__mocks__/fileMock.js', // νμΌ λͺ¨νΉ μ²λ¦¬
},
testEnvironment: 'jsdom',
coverageProvider: 'v8',
};
export default config;