@@ -4,17 +4,38 @@ const config: Config = {
44 preset : 'ts-jest' ,
55 testEnvironment : 'jsdom' ,
66 transform : {
7- '^.+\\.(ts|tsx)$' : 'ts-jest' ,
8- '^.+\\.(js|jsx)$' : 'babel-jest' ,
7+ '^.+\\.(ts|tsx)$' : [ 'ts-jest' , {
8+ useESM : true ,
9+ } ] ,
10+ '^.+\\.(js|jsx|mjs)$' : [ 'babel-jest' , {
11+ presets : [
12+ [ '@babel/preset-env' , {
13+ targets : {
14+ node : 'current' ,
15+ } ,
16+ } ] ,
17+ '@babel/preset-react' ,
18+ '@babel/preset-typescript'
19+ ] ,
20+ } ] ,
921 } ,
1022 moduleNameMapper : {
23+ '^monaco-editor$' : '<rootDir>/__mocks__/monaco-editor.js' ,
24+ "@logicflow" : "<rootDir>/node_modules/@logicflow/core/dist/index.min.js" ,
1125 '\\.(css|less|scss|sass)$' : 'identity-obj-proxy' ,
1226 '\\.(jpg|jpeg|png|gif|webp|svg)$' : '<rootDir>/__mocks__/fileMock.js' ,
1327 '^@/(.*)$' : '<rootDir>/src/$1'
1428 } ,
1529 setupFilesAfterEnv : [ '<rootDir>/src/jest.setup.ts' ] ,
16- testRegex : '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$' ,
17- moduleFileExtensions : [ 'ts' , 'tsx' , 'js' , 'jsx' , 'json' , 'node' ]
30+ testMatch : [
31+ "**/__test__/**/*.[jt]s?(x)" ,
32+ "**/__tests__/**/*.[jt]s?(x)" ,
33+ "**/?(*.)+(spec|test).[jt]s?(x)"
34+ ] ,
35+ moduleFileExtensions : [ 'ts' , 'tsx' , 'js' , 'jsx' , 'json' , 'node' ] ,
36+ transformIgnorePatterns : [
37+ 'node_modules/(?!(lodash-es|@ant-design|@logicflow|other-esm-modules)/)'
38+ ] ,
1839} ;
1940
2041export default config ;
0 commit comments