forked from codingapi/springboot-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
41 lines (39 loc) · 1.29 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
import type { Config } from 'jest';
const config: Config = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
transform: {
'^.+\\.(ts|tsx)$': ['ts-jest', {
useESM: true,
}],
'^.+\\.(js|jsx|mjs)$': ['babel-jest', {
presets: [
['@babel/preset-env', {
targets: {
node: 'current',
},
}],
'@babel/preset-react',
'@babel/preset-typescript'
],
}],
},
moduleNameMapper: {
'^monaco-editor$': '<rootDir>/__mocks__/monaco-editor.js',
"@logicflow": "<rootDir>/node_modules/@logicflow/core/dist/index.min.js",
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
'\\.(jpg|jpeg|png|gif|webp|svg)$': '<rootDir>/__mocks__/fileMock.js',
'^@/(.*)$': '<rootDir>/src/$1'
},
setupFilesAfterEnv: ['<rootDir>/src/jest.setup.ts'],
testMatch: [
"**/__test__/**/*.[jt]s?(x)",
"**/__tests__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test).[jt]s?(x)"
],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
transformIgnorePatterns: [
'node_modules/(?!(lodash-es|@ant-design|@logicflow|other-esm-modules)/)'
],
};
export default config;