@@ -83,6 +83,14 @@ const config: Config = {
8383 // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
8484 moduleNameMapper : {
8585 "^(\\.{1,2}/.*)\\.js$" : "$1" ,
86+ "^@actions/core$" : "<rootDir>/node_modules/@actions/core/lib/core.js" ,
87+ "^@actions/io$" : "<rootDir>/node_modules/@actions/io/lib/io.js" ,
88+ "^@actions/io/lib/(.*)$" : "<rootDir>/node_modules/@actions/io/lib/$1" ,
89+ "^@actions/exec$" : "<rootDir>/node_modules/@actions/exec/lib/exec.js" ,
90+ "^@actions/exec/lib/(.*)$" : "<rootDir>/node_modules/@actions/exec/lib/$1" ,
91+ "^@actions/http-client$" : "<rootDir>/node_modules/@actions/http-client/lib/index.js" ,
92+ "^@actions/http-client/lib/(.*)$" : "<rootDir>/node_modules/@actions/http-client/lib/$1" ,
93+ "^@actions/core/lib/(.*)$" : "<rootDir>/node_modules/@actions/core/node_modules/@actions/http-client/lib/$1" ,
8694 } ,
8795
8896 // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
@@ -95,14 +103,14 @@ const config: Config = {
95103 // notifyMode: "failure-change",
96104
97105 // A preset that is used as a base for Jest's configuration
98- preset : "ts-jest/presets/default-esm" ,
99-
100- // An array of file extensions your modules use
101- extensionsToTreatAsEsm : [ ".ts" ] ,
106+ preset : "ts-jest" ,
102107
103108 // Run tests from one or more projects
104109 // projects: undefined,
105110
111+ // A path to a custom resolver
112+ resolver : "<rootDir>/jest-resolver.cjs" ,
113+
106114 // Use this configuration option to add custom reporters to Jest
107115 // reporters: undefined,
108116
@@ -179,10 +187,20 @@ const config: Config = {
179187 } ,
180188 ] ,
181189 "^.+\\.(js|jsx|mjs|cjs)$" : [
182- "babel- jest" ,
190+ "@swc/ jest" ,
183191 {
184- presets : [ "@babel/preset-env" ] ,
185- plugins : [ "@babel/plugin-transform-modules-commonjs" ] ,
192+ jsc : {
193+ parser : {
194+ syntax : "ecmascript" ,
195+ } ,
196+ transform : {
197+ useDefineForClassFields : false ,
198+ } ,
199+ target : "es2022" ,
200+ } ,
201+ module : {
202+ type : "commonjs" ,
203+ } ,
186204 } ,
187205 ] ,
188206 } ,
0 commit comments