Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Comments

@ColtHands
Copy link
Contributor

ColtHands commented Aug 26, 2020

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 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.0 Reference issue comment. Which some times requires to move .babelrc to babel.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"] } inside package.json
  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant