forked from cilium/hubble-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
33 lines (33 loc) · 925 Bytes
/
jest.config.js
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
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
testMatch: [
'<rootDir>/src/**/?(*.)(spec|test).(j|t)s?(x)',
'<rootDir>/src/**/__tests__/**/*.(j|t)s?(x)',
],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.test.json',
useESM: true,
isolatedModules: true,
babelConfig: {
presets: ['@babel/preset-env', '@babel/preset-react'],
},
},
},
roots: ['<rootDir>/src'],
moduleNameMapper: {
'\\.(png|jpg|gif|ttf|woff|woff2)$':
'<rootDir>/scripts/assets-transformer.js',
'\\.(css|styl|less|sass|scss)$': 'identity-obj-proxy',
'\\.svg$': '<rootDir>/scripts/svg-mock.js',
'^~/(.*)$': '<rootDir>/src/$1',
'^~backend/(.*)$': '<rootDir>/backend/$1',
},
transform: {
'^.+\\.tsx?$': 'ts-jest/legacy',
'^.+\\.(js|jsx)$': 'babel-jest',
},
transformIgnorePatterns: [],
setupFilesAfterEnv: ['./scripts/jest.setup.js'],
};