Skip to content

Commit 8fb9e94

Browse files
authored
docs: add note in testing SFCs with Jest for Vue CLI users (#1556)
* docs: add note in testing SFCs with Jest for Vue CLI users Add a note to help people know which instructions to follow when testing SFCs using the Jest and Vue CLI. Current instructions assume webpack setup. * docs: update text in Testing SFCs with Jest be more straightforward
1 parent 10925ee commit 8fb9e94

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/guides/testing-single-file-components-with-jest.md

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ Jest is a test runner developed by Facebook, aiming to deliver a battery-include
1010

1111
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`.
1212

13+
> 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.
14+
>
15+
> 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.
16+
>
17+
> 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.
18+
1319
The first thing to do is install Jest and Vue Test Utils:
1420

1521
```bash

0 commit comments

Comments
 (0)