vuejs / vue-jest

Jest Vue transformer
MIT License
746 stars 157 forks source link

README mistake regarding "babel-core@bridge" #524

Open yairEO opened 1 year ago

yairEO commented 1 year ago

This section is confusing: https://github.com/vuejs/vue-jest#usage-with-babel-7

If you use jest > 24.0.0 and babel-jest make sure to install babel-core@bridge

babel-jest is already using @babel/core version 7+:

https://github.com/facebook/jest/blob/main/packages/babel-jest/package.json#L30

So why would you need to install the bride? it's needed only when other packages are using Babel version below 7.


Also worth mentioning in the README that this package is not needed if one already has Babel installed & configured with a Babel configuration file & preset for vue, because all Jest tests files automatically pass through it, as clearly mentioned in Jest "getting started" docs:

image

So, it is very confusing, as why vue-jest is needed at all.

One can only assume, after installing Babel, the next logical step is to install a preset, and for vue, that would be: https://www.npmjs.com/package/@vue/babel-preset-app