Skip to content

docs: add note in testing SFCs with Jest for Vue CLI users #1556

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

Merged
merged 2 commits into from
May 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/guides/testing-single-file-components-with-jest.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ Jest is a test runner developed by Facebook, aiming to deliver a battery-include

We will assume you are starting with a setup that already has webpack, vue-loader and Babel properly configured - e.g. the `webpack-simple` template scaffolded by `vue-cli`.

> Alternatively, if you are using the Vue CLI to build your project, you can use the plugin [cli-plugin-unit-jest](https://cli.vuejs.org/core-plugins/unit-jest.html#injected-commands) to run Jest tests.
>
> Skip to and then follow the instructions from [Processing Single-File Components in Jest](#processing-single-file-components-in-jest) to process your Vue Single-File Components.
>
> If you are transpiling with Babel (the default configuration when creating a new project), you will also need to add the JavaScript transform to the Jest config in your package.json as described in the section [Configuring Babel for Jest](#configuring-babel-for-fest), but then you should skip the rest of that section.

The first thing to do is install Jest and Vue Test Utils:

```bash
Expand Down