mirror of
https://github.com/pieartsy/PluralFlux.git
synced 2026-04-14 20:15:28 +10:00
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} */
|
||||
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')
|
||||
},
|
||||
};
|
||||
22
package.json
22
package.json
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
import * as dotenv from "dotenv";
|
||||
dotenv.config({ path: "env.jest" });
|
||||
Reference in New Issue
Block a user