Closed
Description
Documentation Feedback
Improving on Using with Jest and Getting started
Key issues with Using with Jest
- This guide is not at all complete and will require more steps to actually get started
- Those additional steps require adding additional dependencies some of which are peer dependencies which may produce unexpected errors.
Key issues with Getting started
- First line of the example is
import { mount } from '@vue/test-utils'
statement which results inSyntaxError: Cannot use import statement outside a module
error. - This requires an additional setup with babel jest, which is not mentioned in Using with Jest part of the docs.
"transform": { "^.+\\.js$": "babel-jest" }
- Which in addition requires sometimes spits out an error that it requires
babel-core
not@babel/core
, not only that it requires specificbabel-core@^7.0.0-bridge.0
Reference issue comment. Which some times requires to move.babelrc
tobabel.config.js
Reference issue comment - This could be solved by simple additional installation requirements and simple babel config inside
package.json
Proposition
Add few additional installation requirements inside using with jest or getting started docs, which are
- changing Note about
babel-bridge
to clear instruction on how to install and add babel support - adding
@babel/core
@babel/preset-env
babel-jest
babel-core@^7.0.0-bridge.0
packages - adding
"babel": { "presets": ["@babel/preset-env"] }
insidepackage.json
- adding
"jest": { "transform": { ".*\\.(js)$": "babel-jest" }
insidepackage.json
or other Jest config
I would love to participate and work on that issue adding additional info inside docs. With additional discussion from the developers and clear requirements in what doc file should be modified and what should be added.
My understanding is that Using with Jest should be modified, with additional babel setup info. I'll work on adding the docs and will create a pull request for a review.
Metadata
Metadata
Assignees
Labels
No labels