Jest with Vue.js and Babel Unknown Option
April 7, 2020
I was trying to run a Jest unit test against a vue.js component. I was getting the following error:
FAIL src/components/UserList.spec.js ● Test suite failed to run ReferenceError: [BABEL] unknown: Unknown option: C:\Users\drumcoder\app\node_modules\@vue\cli-plugin-babel\preset.js.overrides. Check out http://babeljs.io/docs/usage/options/ for more information about options. A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example: Invalid: `{ presets: [{option: value}] }` Valid: `{ presets: [['presetName', {option: value}]] }` For more detailed information on preset configuration, please see https://babeljs.io/docs/en/plugins#pluginpresets-options.
I managed for fix this by updating to a later version of babel-core
npm install babel-core@^7.0.0-bridge.0