added babel to convert es modules to cjs

This commit is contained in:
Aster Fialla
2026-02-17 20:48:44 -05:00
parent 164ff7d8b6
commit a4804c2ea7
4 changed files with 19 additions and 25 deletions

8
babel.config.js Normal file
View File

@@ -0,0 +1,8 @@
// babel.config.js
module.exports = {
env: {
test: {
plugins: ["@babel/plugin-transform-modules-commonjs"]
}
}
};

View File

@@ -1,11 +1,11 @@
/** @type {import('jest').Config} */
const config = {
// jest.config.js
module.exports = {
clearMocks: true,
collectCoverage: true,
coverageDirectory: "coverage",
setupFiles: ["<rootDir>/jest.setup.js"], // path to a setup module to configure the testing environment before each test
transform: {},
verbose: true,
};
export default config;
transform: {
"^.+\\.[t|j]sx?$": require.resolve('babel-jest')
},
};

View File

@@ -3,7 +3,6 @@
"version": "1.0.0",
"description": "",
"main": "src/bot.js",
"type": "module",
"repository": {
"type": "git",
"url": "https://github.com/pieartsy/PluralFlux.git"
@@ -19,24 +18,13 @@
"tmp": "^0.2.5"
},
"devDependencies": {
"@babel/core": "^7.29.0",
"@babel/plugin-transform-modules-commonjs": "^7.28.6",
"@babel/preset-env": "^7.29.0",
"babel-jest": "^30.2.0",
"jest": "^30.2.0"
},
"scripts": {
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
},
"jest": {
"testEnvironment": "node",
"coveragePathIgnorePatterns": [
"/node_modules/"
],
"moduleFileExtensions": [
"js",
"json"
],
"testMatch": [
"**/__tests__/**/*.js",
"**/?(*.)+(spec|test).js"
],
"verbose": true
"test": "jest"
}
}

View File

@@ -1,2 +0,0 @@
import * as dotenv from "dotenv";
dotenv.config({ path: "env.jest" });