You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improving on "Using with jest" and "Getting started" docs. (Basic jest, vue-jest and vue-test-utils setup is not enough to get started, requires more setup and leads to unexpected errors)
#1666
Closed
ColtHands opened this issue
Aug 26, 2020
· 0 comments
First line of the example is import { mount } from '@vue/test-utils' statement which results in SyntaxError: 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 specific babel-core@^7.0.0-bridge.0Reference issue comment. Which some times requires to move .babelrc to babel.config.jsReference 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 "jest": { "transform": { ".*\\.(js)$": "babel-jest" } inside package.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.
The text was updated successfully, but these errors were encountered:
Documentation Feedback
Improving on Using with Jest and Getting started
Key issues with Using with Jest
Key issues with Getting started
import { mount } from '@vue/test-utils'
statement which results inSyntaxError: Cannot use import statement outside a module
error."transform": { "^.+\\.js$": "babel-jest" }
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 commentpackage.json
Proposition
Add few additional installation requirements inside using with jest or getting started docs, which are
babel-bridge
to clear instruction on how to install and add babel support@babel/core
@babel/preset-env
babel-jest
babel-core@^7.0.0-bridge.0
packages"babel": { "presets": ["@babel/preset-env"] }
insidepackage.json
"jest": { "transform": { ".*\\.(js)$": "babel-jest" }
insidepackage.json
or other Jest configI 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.
The text was updated successfully, but these errors were encountered: