Hey there! I'm encountering an issue with webpack 5 and babel while trying to run tests that were previously written. Despite following the jest documentation for configuration, I haven't been able to find a solution after exploring various forums and GitHub threads. Nothing seems to work no matter what I try. Any assistance would be greatly appreciated! Thanks!
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import { shallowMount, mount, createLocalVue } from '@vue/test-utils';
^
SyntaxError: Unexpected token {
at Runtime.createScriptFromCode (../../node_modules/jest-runtime/build/index.js:1350:14)
package.json
"devDependencies": {
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-regenerator": "^7.12.13",
"@babel/preset-env": "^7.13.12",
"@babel/runtime": "^7.13.10",
"@mdi/js": "^5.9.55",
"@mdi/svg": "^5.9.55",
"@vue/babel-preset-app": "^4.5.12",
"@vue/test-utils": "^1.1.4",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^26.6.3",
...
},
"dependencies": {
"axios": "^0.21.1",
"core-js": "^3.10.0",
"izitoast": "^1.4.0",
"regenerator-runtime": "^0.13.7",
"vue": "^2.6.12",
...
}
...
.babelrc
{
"presets": [["@babel/env", { "modules": false }]],
"env": {
"test": {
"presets": [["@babel/env", { "targets": { "node": "current" } }]]
}
}
}