forked from PluralFlux/PluralFlux
added babel to convert es modules to cjs
This commit is contained in:
8
babel.config.js
Normal file
8
babel.config.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
// babel.config.js
|
||||||
|
module.exports = {
|
||||||
|
env: {
|
||||||
|
test: {
|
||||||
|
plugins: ["@babel/plugin-transform-modules-commonjs"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
/** @type {import('jest').Config} */
|
// jest.config.js
|
||||||
const config = {
|
module.exports = {
|
||||||
clearMocks: true,
|
clearMocks: true,
|
||||||
collectCoverage: true,
|
collectCoverage: true,
|
||||||
coverageDirectory: "coverage",
|
coverageDirectory: "coverage",
|
||||||
setupFiles: ["<rootDir>/jest.setup.js"], // path to a setup module to configure the testing environment before each test
|
setupFiles: ["<rootDir>/jest.setup.js"], // path to a setup module to configure the testing environment before each test
|
||||||
transform: {},
|
|
||||||
verbose: true,
|
verbose: true,
|
||||||
};
|
transform: {
|
||||||
|
"^.+\\.[t|j]sx?$": require.resolve('babel-jest')
|
||||||
export default config;
|
},
|
||||||
|
};
|
||||||
22
package.json
22
package.json
@@ -3,7 +3,6 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "src/bot.js",
|
"main": "src/bot.js",
|
||||||
"type": "module",
|
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/pieartsy/PluralFlux.git"
|
"url": "https://github.com/pieartsy/PluralFlux.git"
|
||||||
@@ -19,24 +18,13 @@
|
|||||||
"tmp": "^0.2.5"
|
"tmp": "^0.2.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"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"
|
"jest": "^30.2.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
|
"test": "jest"
|
||||||
},
|
|
||||||
"jest": {
|
|
||||||
"testEnvironment": "node",
|
|
||||||
"coveragePathIgnorePatterns": [
|
|
||||||
"/node_modules/"
|
|
||||||
],
|
|
||||||
"moduleFileExtensions": [
|
|
||||||
"js",
|
|
||||||
"json"
|
|
||||||
],
|
|
||||||
"testMatch": [
|
|
||||||
"**/__tests__/**/*.js",
|
|
||||||
"**/?(*.)+(spec|test).js"
|
|
||||||
],
|
|
||||||
"verbose": true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
import * as dotenv from "dotenv";
|
|
||||||
dotenv.config({ path: "env.jest" });
|
|
||||||
Reference in New Issue
Block a user