mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-24 07:02:26 +01:00
17 lines
619 B
JavaScript
17 lines
619 B
JavaScript
const babelJest = require("babel-jest").default;
|
|
|
|
module.exports = {
|
|
process(sourceText, sourcePath, options) {
|
|
const alias = options?.config?.moduleNameMapper;
|
|
const extensions = options.config.moduleFileExtensions;
|
|
const babelTransformer = babelJest.createTransformer({
|
|
presets: [["@babel/preset-react"], ["@babel/preset-env"], ["@babel/preset-typescript"]],
|
|
plugins: [["transform-barrels", { executorName: "jest", alias: alias, extensions: extensions }]],
|
|
babelrc: false,
|
|
configFile: false,
|
|
});
|
|
|
|
return babelTransformer.process(sourceText, sourcePath, options);
|
|
},
|
|
};
|