cypress 9.7.0 → 10.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. package/index.mjs +15 -0
  2. package/lib/cli.js +72 -23
  3. package/lib/errors.js +16 -1
  4. package/lib/exec/open.js +45 -10
  5. package/lib/exec/run.js +17 -10
  6. package/lib/exec/shared.js +30 -9
  7. package/lib/exec/spawn.js +4 -0
  8. package/lib/exec/xvfb.js +1 -0
  9. package/lib/util.js +10 -3
  10. package/mount-utils/CHANGELOG.md +20 -0
  11. package/mount-utils/README.md +14 -0
  12. package/mount-utils/dist/index.d.ts +54 -0
  13. package/mount-utils/dist/index.js +134 -0
  14. package/mount-utils/package.json +31 -0
  15. package/package.json +39 -4
  16. package/react/CHANGELOG.md +373 -0
  17. package/react/README.md +414 -0
  18. package/react/dist/cypress-react.browser.js +497 -0
  19. package/react/dist/cypress-react.cjs.js +495 -0
  20. package/react/dist/cypress-react.esm-bundler.js +467 -0
  21. package/react/dist/getDisplayName.d.ts +8 -0
  22. package/react/dist/index.d.ts +2 -0
  23. package/react/dist/mount.d.ts +143 -0
  24. package/react/dist/mountHook.d.ts +11 -0
  25. package/react/package.json +105 -0
  26. package/types/bluebird/index.d.ts +18 -4
  27. package/types/cypress-npm-api.d.ts +4 -10
  28. package/types/cypress.d.ts +172 -120
  29. package/types/minimatch/index.d.ts +15 -5
  30. package/vue/CHANGELOG.md +380 -0
  31. package/vue/README.md +678 -0
  32. package/vue/dist/cypress-vue.cjs.js +13535 -0
  33. package/vue/dist/cypress-vue.esm-bundler.js +13511 -0
  34. package/vue/dist/index.d.ts +56 -0
  35. package/vue/package.json +86 -0
  36. package/vue2/CHANGELOG.md +5 -0
  37. package/vue2/README.md +693 -0
  38. package/vue2/dist/cypress-vue2.browser.js +20191 -0
  39. package/vue2/dist/cypress-vue2.cjs.js +20188 -0
  40. package/vue2/dist/cypress-vue2.esm-bundler.js +20179 -0
  41. package/vue2/dist/index.d.ts +171 -0
  42. package/vue2/package.json +59 -0
package/vue/README.md ADDED
@@ -0,0 +1,678 @@
1
+ # @cypress/vue
2
+
3
+ [![NPM][npm-icon] ][npm-url]
4
+
5
+ [![semantic-release][semantic-image] ][semantic-url]
6
+
7
+ > Browser-based Component Testing for Vue.js with the Open-Source [Cypress.io](https://www.cypress.io/) Test Runner ✌️🌲
8
+ >
9
+ **✨ New** We're growing the Cypress Community Discord. We have dedicated sections on Component Testing. 👉 [Join now](https://discord.com/invite/TmzTGUW) and let's chat!
10
+
11
+ **Jump to:** [Comparison](#comparison), [Blog posts](#blog-posts), Examples: [basic](#basic-examples), [advanced](#advanced-examples), [full](#full-examples), [external](#external-examples), [Code coverage](#code-coverage), [Development](#development)
12
+
13
+ ### What is @cypress/vue?
14
+ This package allows you to use the [Cypress](https://www.cypress.io/) test runner to mount and test your Vue 3.x components within Cypress. It is built on top of the [Vue Test Utils](https://github.com/vuejs/vue-test-utils) package.
15
+
16
+ ![Example component test](images/dynamic.gif)
17
+
18
+ ### How is this different from Vue Test Utils?
19
+ It uses [Vue Test Utils](https://github.com/vuejs/vue-test-utils) under the hood. This is more of a replacement for node-based testing than it is replacing Vue Test Utils and its API. Instead of running your tests in node (using Jest or Mocha), the Cypress Component Testing Library runs each component in the **real browser** with full power of the Cypress Framework: [live GUI, full API, screen recording, CI support, cross-platform](https://www.cypress.io/features/). One benefit to using Cypress instead of a node-based runner is that limitations of Vue Test Utils in Node (e.g. manually awaiting Vue's internal event loop) are hidden from the user due to Cypress's retry-ability logic.
20
+
21
+ - If you like using `@testing-library/vue`, you can use `@testing-library/cypress` for the same `findBy`, `queryBy` commands, see one of the examples in the list below
22
+
23
+ ### How is this different from @cypress/vue2?
24
+ Cypress packages the current version of Vue under @cypress/vue, and older versions under separate package names. Use [@cypress/vue2](cypress-vue2-npm-url) if you're still using vue@2, and this package if you're on vue@3.
25
+
26
+ ## Installation
27
+
28
+ - Requires Cypress v7.0.0 or later
29
+ - Requires [Node](https://nodejs.org/en/) version 12 or above
30
+ - Requires Vue 3.x. If you are using Vue 2.x, you want [@cypress/vue2](cypress-vue2-npm-url) instead.
31
+ - Supports projects built with Vue CLI, Vite, and Webpack. If you would like us to support another build configuration, please [create an issue](https://github.com/cypress-io/cypress/issues/new?assignees=&labels=npm:%20@cypress/vue&template=3-feature.md).
32
+
33
+ Now you are ready to install.
34
+
35
+ ### Manual Installation
36
+
37
+ Using [@cypress/webpack-dev-server](https://github.com/cypress-io/cypress-webpack-preprocessor#readme) and [vue-loader](https://github.com/vuejs/vue-loader).
38
+
39
+ ```js
40
+ // cypress/plugins/index.js
41
+ const webpack = require('@cypress/webpack-dev-server')
42
+ const webpackOptions = {
43
+ module: {
44
+ rules: [
45
+ {
46
+ test: /\.vue$/,
47
+ loader: 'vue-loader',
48
+ },
49
+ ],
50
+ },
51
+ }
52
+
53
+ const options = {
54
+ // send in the options from your webpack.config.js, so it works the same
55
+ // as your app's code
56
+ webpackOptions,
57
+ watchOptions: {},
58
+ }
59
+
60
+ module.exports = (on) => {
61
+ on('dev-server:start', webpack(options))
62
+ }
63
+ ```
64
+
65
+ Install dev dependencies
66
+
67
+ ```shell
68
+ npm i -D @cypress/webpack-dev-server @cypress/vue
69
+ ```
70
+
71
+ And write a test
72
+
73
+ ```js
74
+ import Hello from '../../components/Hello.vue'
75
+ import { mountCallback } from '@cypress/vue'
76
+
77
+ describe('Hello.vue', () => {
78
+ beforeEach(mountCallback(Hello))
79
+
80
+ it('shows hello', () => {
81
+ cy.contains('Hello World!')
82
+ })
83
+ })
84
+ ```
85
+
86
+ ## Usage and Examples
87
+
88
+ ```js
89
+ // components/HelloWorld.spec.js
90
+ import { mount } from '@cypress/vue'
91
+ import { HelloWorld } from './HelloWorld.vue'
92
+ describe('HelloWorld component', () => {
93
+ it('works', () => {
94
+ mount(HelloWorld)
95
+ // now use standard Cypress commands
96
+ cy.contains('Hello World!').should('be.visible')
97
+ })
98
+ })
99
+ ```
100
+
101
+ ### Options
102
+
103
+ You can pass additional styles, css files and external stylesheets to load, see [docs/styles.md](./docs/styles.md) for full list.
104
+
105
+ ```js
106
+ import Todo from './Todo.vue'
107
+ const todo = {
108
+ id: '123',
109
+ title: 'Write more tests',
110
+ }
111
+
112
+ mount(Todo, {
113
+ propsData: { todo },
114
+ stylesheets: [
115
+ 'https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.2/css/bulma.css',
116
+ ],
117
+ })
118
+ ```
119
+
120
+ See examples below for details.
121
+
122
+ ### Global Vue Options
123
+
124
+ You can pass extensions (global components, mixins, modules to use)
125
+ when mounting Vue component. Use `{ extensions: { ... }}` object inside
126
+ the `options`.
127
+
128
+ - `components` - object of 'id' and components to register globally, see [Components](npm/vue/cypress/component/basic/components) example
129
+ - `use` (alias `plugins`) - list of plugins, see [Plugins](npm/vue/cypress/component/basic/plugins)
130
+ - `mixin` (alias `mixins`) - list of global mixins, see [Mixins](npm/vue/cypress/component/basic/mixins) example
131
+ - `filters` - hash of global filters, see [Filters](npm/vue/cypress/component/basic/filters) example
132
+
133
+ ### intro example
134
+
135
+ Take a look at the first Vue v2 example:
136
+ [Declarative Rendering](https://vuejs.org/v2/guide/#Declarative-Rendering).
137
+ The code is pretty simple
138
+
139
+ ```html
140
+ <div id="app">
141
+ {{ message }}
142
+ </div>
143
+ ```
144
+
145
+ ```js
146
+ var app = new Vue({
147
+ el: '#app',
148
+ data() {
149
+ return { message: 'Hello Vue!' }
150
+ },
151
+ })
152
+ ```
153
+
154
+ It shows the message when running in the browser
155
+
156
+ ```
157
+ Hello Vue!
158
+ ```
159
+
160
+ Let's test it in [Cypress.io][cypress.io] (for the current version see
161
+ [cypress/integration/spec.js](cypress/integration/spec.js)).
162
+
163
+ ```js
164
+ import { mountCallback } from '@cypress/vue'
165
+
166
+ describe('Declarative rendering', () => {
167
+ // Vue code from https://vuejs.org/v2/guide/#Declarative-Rendering
168
+ const template = `
169
+ <div id="app">
170
+ {{ message }}
171
+ </div>
172
+ `
173
+
174
+ const data = {
175
+ message: 'Hello Vue!',
176
+ }
177
+
178
+ // that's all you need to do
179
+ beforeEach(mountCallback({ template, data }))
180
+
181
+ it('shows hello', () => {
182
+ cy.contains('Hello Vue!')
183
+ })
184
+
185
+ it('changes message if data changes', () => {
186
+ // mounted Vue instance is available under Cypress.vue
187
+ Cypress.vue.message = 'Vue rocks!'
188
+ cy.contains('Vue rocks!')
189
+ })
190
+ })
191
+ ```
192
+
193
+ Fire up Cypress test runner and have real browser (Electron, Chrome) load
194
+ Vue and mount your test code and be able to interact with the instance through
195
+ the reference `Cypress.vue.$data` and via GUI. The full power of the
196
+ [Cypress API](https://on.cypress.io/api) is available.
197
+
198
+ ![Hello world tested](images/spec.png)
199
+
200
+ ### list example
201
+
202
+ There is a list example next in the Vue docs.
203
+
204
+ ```html
205
+ <div id="app-4">
206
+ <ol>
207
+ <li v-for="todo in todos">
208
+ {{ todo.text }}
209
+ </li>
210
+ </ol>
211
+ </div>
212
+ ```
213
+
214
+ ```js
215
+ var app4 = new Vue({
216
+ el: '#app-4',
217
+ data: {
218
+ todos: [
219
+ { text: 'Learn JavaScript' },
220
+ { text: 'Learn Vue' },
221
+ { text: 'Build something awesome' },
222
+ ],
223
+ },
224
+ })
225
+ ```
226
+
227
+ Let's test it. Simple.
228
+
229
+ ```js
230
+ import { mountCallback } from '@cypress/vue'
231
+
232
+ describe('Declarative rendering', () => {
233
+ // List example from https://vuejs.org/v2/guide/#Declarative-Rendering
234
+ const template = `
235
+ <ol>
236
+ <li v-for="todo in todos">
237
+ {{ todo.text }}
238
+ </li>
239
+ </ol>
240
+ `
241
+
242
+ function data() {
243
+ return {
244
+ todos: [
245
+ { text: 'Learn JavaScript' },
246
+ { text: 'Learn Vue' },
247
+ { text: 'Build something awesome' },
248
+ ],
249
+ }
250
+ }
251
+
252
+ beforeEach(mountCallback({ template, data }))
253
+
254
+ it('shows 3 items', () => {
255
+ cy.get('li').should('have.length', 3)
256
+ })
257
+
258
+ it('can add an item', () => {
259
+ Cypress.vue.todos.push({ text: 'Test using Cypress' })
260
+ cy.get('li').should('have.length', 4)
261
+ })
262
+ })
263
+ ```
264
+
265
+ ![List tested](images/list-spec.png)
266
+
267
+ ### Handling User Input
268
+
269
+ The next section in the Vue docs starts with [reverse message example](https://vuejs.org/v2/guide/#Handling-User-Input).
270
+
271
+ ```html
272
+ <div id="app-5">
273
+ <p>{{ message }}</p>
274
+ <button @click="reverseMessage">Reverse Message</button>
275
+ </div>
276
+ ```
277
+
278
+ ```js
279
+ var app5 = new Vue({
280
+ el: '#app-5',
281
+ data: {
282
+ message: 'Hello Vue.js!',
283
+ },
284
+ methods: {
285
+ reverseMessage: function () {
286
+ this.message = this.message.split('').reverse().join('')
287
+ },
288
+ },
289
+ })
290
+ ```
291
+
292
+ We can write the test the same way
293
+
294
+ ```js
295
+ import { mountCallback } from '@cypress/vue'
296
+
297
+ describe('Handling User Input', () => {
298
+ // Example from https://vuejs.org/v2/guide/#Handling-User-Input
299
+ const template = `
300
+ <div>
301
+ <p>{{ message }}</p>
302
+ <button @click="reverseMessage">Reverse Message</button>
303
+ </div>
304
+ `
305
+
306
+ function data() {
307
+ return { message: 'Hello Vue.js!' }
308
+ }
309
+
310
+ const methods = {
311
+ reverseMessage: function () {
312
+ this.message = this.message.split('').reverse().join('')
313
+ },
314
+ }
315
+
316
+ beforeEach(mountCallback({ template, data, methods }))
317
+
318
+ it('reverses text', () => {
319
+ cy.contains('Hello Vue')
320
+ cy.get('button').click()
321
+ cy.contains('!sj.euV olleH')
322
+ })
323
+ })
324
+ ```
325
+
326
+ Take a look at the video of the test. When you hover over the `CLICK` step
327
+ the test runner is showing _before_ and _after_ DOM snapshots. Not only that,
328
+ the application is fully functioning, you can interact with the application
329
+ because it is really running!
330
+
331
+ ![Reverse input](images/reverse-spec.gif)
332
+
333
+ <a name="component-example"/>
334
+
335
+ ### Component example
336
+
337
+ Let us test a complex example. Let us test a [single file Vue component](https://vuejs.org/v2/guide/single-file-components.html). Here is the [Hello.vue](Hello.vue) file
338
+
339
+ ```vue
340
+ <template>
341
+ <p>{{ greeting }} World!</p>
342
+ </template>
343
+
344
+ <script>
345
+ export default {
346
+ data() {
347
+ return {
348
+ greeting: 'Hello',
349
+ }
350
+ },
351
+ }
352
+ </script>
353
+
354
+ <style scoped>
355
+ p {
356
+ font-size: 2em;
357
+ text-align: center;
358
+ }
359
+ </style>
360
+ ```
361
+
362
+ **note** to learn how to load Vue component files in Cypress, see
363
+ [Bundling](#bundling) section.
364
+
365
+ Do you want to interact with the component? Go ahead! Do you want
366
+ to have multiple components? No problem!
367
+
368
+ ```js
369
+ import Hello from '../../components/Hello.vue'
370
+ import { mountCallback } from '@cypress/vue'
371
+ describe('Several components', () => {
372
+ const template = `
373
+ <div>
374
+ <hello></hello>
375
+ <hello></hello>
376
+ <hello></hello>
377
+ </div>
378
+ `
379
+ const components = {
380
+ hello: Hello,
381
+ }
382
+ beforeEach(mountCallback({ template, components }))
383
+
384
+ it('greets the world 3 times', () => {
385
+ cy.get('p').should('have.length', 3)
386
+ })
387
+ })
388
+ ```
389
+
390
+ ### Spying example
391
+
392
+ Button counter component is used in several Vue doc examples
393
+
394
+ ```vue
395
+ <template>
396
+ <button @click="incrementCounter">{{ counter }}</button>
397
+ </template>
398
+
399
+ <script>
400
+ export default {
401
+ data() {
402
+ return {
403
+ counter: 0,
404
+ }
405
+ },
406
+
407
+ methods: {
408
+ incrementCounter: function () {
409
+ this.counter += 1
410
+ this.$emit('increment')
411
+ },
412
+ },
413
+ }
414
+ </script>
415
+
416
+ <style scoped>
417
+ button {
418
+ margin: 5px 10px;
419
+ padding: 5px 10px;
420
+ border-radius: 3px;
421
+ }
422
+ </style>
423
+ ```
424
+
425
+ Let us test it - how do we ensure the event is emitted when the button is clicked?
426
+ Simple - let us spy on the event, [spying and stubbing is built into Cypress](https://on.cypress.io/stubs-spies-and-clocks)
427
+
428
+ ```js
429
+ import ButtonCounter from '../../components/ButtonCounter.vue'
430
+ import { mountCallback } from '@cypress/vue'
431
+
432
+ describe('ButtonCounter', () => {
433
+ beforeEach(mountCallback(ButtonCounter))
434
+
435
+ it('starts with zero', () => {
436
+ cy.contains('button', '0')
437
+ })
438
+
439
+ it('increments the counter on click', () => {
440
+ cy.get('button').click().click().click().contains('3')
441
+ })
442
+
443
+ it('emits "increment" event on click', () => {
444
+ const spy = cy.spy()
445
+ Cypress.vue.$on('increment', spy)
446
+ cy.get('button')
447
+ .click()
448
+ .click()
449
+ .then(() => {
450
+ expect(spy).to.be.calledTwice
451
+ })
452
+ })
453
+ })
454
+ ```
455
+
456
+ The component is really updating the counter in response to the click
457
+ and is emitting an event.
458
+
459
+ ![Spying test](images/spy-spec.png)
460
+
461
+ [cypress.io]: https://www.cypress.io/
462
+
463
+ <a name="xhr-spying-stubbing"/>
464
+
465
+ ### XHR spying and stubbing
466
+
467
+ The mount function automatically wraps XMLHttpRequest giving you an ability to intercept XHR requests your component might do. For full documentation see [Network Requests](https://on.cypress.io/network-requests). In this repo see [components/AjaxList.vue](components/AjaxList.vue) and the corresponding tests [cypress/integration/ajax-list-spec.js](cypress/integration/ajax-list-spec.js).
468
+
469
+ ```js
470
+ // component use axios to get list of users
471
+ created() {
472
+ axios.get(`https://jsonplaceholder.cypress.io/users?_limit=3`)
473
+ .then(response => {
474
+ // JSON responses are automatically parsed.
475
+ this.users = response.data
476
+ })
477
+ }
478
+ // test can observe, return mock data, delay and a lot more
479
+ beforeEach(mountCallback(AjaxList))
480
+ it('can inspect real data in XHR', () => {
481
+ cy.server()
482
+ cy.route('/users?_limit=3').as('users')
483
+ cy.wait('@users').its('response.body').should('have.length', 3)
484
+ })
485
+ it('can display mock XHR response', () => {
486
+ cy.server()
487
+ const users = [{id: 1, name: 'foo'}]
488
+ cy.route('GET', '/users?_limit=3', users).as('users')
489
+ cy.get('li').should('have.length', 1)
490
+ .first().contains('foo')
491
+ })
492
+ ```
493
+
494
+ <a name="spying-window-alert"/>
495
+
496
+ ### Spying on `window.alert`
497
+
498
+ Calls to `window.alert` are automatically recorded, but do not show up. Instead you can spy on them, see [AlertMessage.vue](components/AlertMessage.vue) and its test [cypress/integration/alert-spec.js](cypress/integration/alert-spec.js)
499
+
500
+ ## Comparison
501
+
502
+ <!-- prettier-ignore-start -->
503
+ Feature | Vue Test Utils or @testing-library/vue | Cypress + `@cypress/vue`
504
+ --- | --- | ---
505
+ Test runs in real browser | ❌ | ✅
506
+ Uses full mount | ❌ | ✅
507
+ Test speed | 🏎 | as fast as the app works in the browser
508
+ Test can use additional plugins | maybe | use any [Cypress plugin](https://on.cypress.io/plugins)
509
+ Test can interact with component | synthetic limited API | use any [Cypress command](https://on.cypress.io/api)
510
+ Test can be debugged | via terminal and Node debugger | use browser DevTools
511
+ Built-in time traveling debugger | ❌ | Cypress time traveling debugger
512
+ Re-run tests on file or test change | ✅ | ✅
513
+ Test output on CI | terminal | terminal, screenshots, videos
514
+ Tests can be run in parallel | ✅ | ✅ via [parallelization](https://on.cypress.io/parallelization)
515
+ Test against interface | if using `@testing-library/vue` | ✅ and can use `@testing-library/cypress`
516
+ Spying and mocking | Jest mocks | Sinon library
517
+ Code coverage | ✅ | ✅
518
+ <!-- prettier-ignore-end -->
519
+
520
+ ## Examples
521
+
522
+ ```js
523
+ // components/HelloWorld.spec.js
524
+ import { mount } from '@cypress/vue'
525
+ import { HelloWorld } from './HelloWorld.vue'
526
+ describe('HelloWorld component', () => {
527
+ it('works', () => {
528
+ mount(HelloWorld)
529
+ // now use standard Cypress commands
530
+ cy.contains('Hello World!').should('be.visible')
531
+ })
532
+ })
533
+ ```
534
+
535
+ ### Basic examples
536
+
537
+ <!-- prettier-ignore-start -->
538
+ Spec | Description
539
+ --- | ---
540
+ [Components](cypress/component/basic/components) | Registers global components to use
541
+ [Filters](cypress/component/basic/filters) | Registering global filters
542
+ [Hello](cypress/component/basic/hello) | Testing examples from Vue2 cookbook
543
+ [Mixins](cypress/component/basic/mixins) | Registering Vue mixins
544
+ [Plugins](cypress/component/basic/plugins) | Loading additional plugins
545
+ [Props](cypress/component/basic/props) | Pass props to the component during mount
546
+ [Slots](cypress/component/basic/slots) | Passing slots and scopedSlots to the component
547
+ [Small examples](cypress/component/basic/small-examples) | A few small examples testing forms, buttons
548
+ <!-- prettier-ignore-end -->
549
+
550
+ ### Advanced examples
551
+
552
+ <!-- prettier-ignore-start -->
553
+ Spec | Description
554
+ --- | ---
555
+ [access-component](cypress/component/advanced/access-component) | Access the mounted component directly from test
556
+ [i18n](cypress/component/advanced/i18n) | Testing component that uses [Vue I18n](https://kazupon.github.io/vue-i18n/) plugin
557
+ [mocking-axios](cypress/component/advanced/mocking-axios) | Mocking 3rd party CommonJS modules like `axios`
558
+ [mocking-fetch](cypress/component/advanced/mocking-fetch) | Mocking `window.fetch` to stub responses and test the UI
559
+ [fetch-polyfill](ypress/component/advanced/fetch-polyfill) | Using experimental `fetch` polyfill to spy on / stub those Ajax requests using regular Cypress network methods
560
+ [mocking-components](cypress/component/advanced/mocking-components) | Mocking locally registered child components during tests
561
+ [mocking-imports](cypress/component/advanced/mocking-imports) | Stub ES6 imports from the tests
562
+ [render-functions](cypress/component/advanced/render-functions) | Mounting components with a [render function](https://www.tutorialandexample.com/vue-js-render-functions/)
563
+ <!-- prettier-ignore-end -->
564
+
565
+ ### Full examples
566
+
567
+ We have several subfolders in [examples](examples) folder.
568
+
569
+ <!-- prettier-ignore-start -->
570
+ Folder Name | Description
571
+ --- | ---
572
+ [cli](examples/cli) | An example app scaffolded using Vue CLI and the component testing added using `vue add cypress-experimental` command.
573
+ <!-- prettier-ignore-end -->
574
+
575
+ ### External examples
576
+
577
+ <!-- prettier-ignore-start -->
578
+ Repo | Description
579
+ --- | ---
580
+ [vue-component-test-example](https://github.com/bahmutov/vue-component-test-example) | Scaffolded Vue CLI v3 project with added component tests, read [Write Your First Vue Component Test](https://glebbahmutov.com/blog/first-vue-component-test/).
581
+ <!-- prettier-ignore-end -->
582
+
583
+
584
+
585
+ ## Code coverage
586
+
587
+ This plugin uses `babel-plugin-istanbul` to automatically instrument `.js` and `.vue` files and generates the code coverage report using dependency [cypress-io/code-coverage](https://github.com/cypress-io/code-coverage) (included). The output reports are saved in the folder "coverage" at the end of the test run.
588
+
589
+ If you want to disable code coverage instrumentation and reporting, use `--env coverage=false` or `CYPRESS_coverage=false` or set in your `cypress.json` file
590
+
591
+ ```json
592
+ {
593
+ "env": {
594
+ "coverage": false
595
+ }
596
+ }
597
+ ```
598
+
599
+ **Note ⚠️:** if the component `.vue` file does not have a `<script>` section, it will not have any code coverage information.
600
+
601
+ ## What happened to cypress-vue-unit-test?
602
+
603
+ We were in the middle of moving into the Cypress NPM org, so any references to `cypress-vue-unit-test` should be switched to `@cypress/vue`. Once complete, the old repository will be archived.
604
+
605
+ ## Development
606
+
607
+ To see all local tests, install dependencies, build the code and open Cypress using the open --component command
608
+
609
+ ```sh
610
+ yarn install
611
+ yarn workspace @cypress/vue build
612
+ ```
613
+
614
+ The build is done using `rollup`. It bundles all files from [src](src) to the `dist` folder. You can then run component tests by opening Cypress
615
+
616
+ ```sh
617
+ # cypress open --component
618
+ yarn workspace @cypress/vue cy:open
619
+ ```
620
+
621
+ Larger tests that use full application and run on CI (see [circle.yml](circle.yml)) are located in the folder [examples](examples).
622
+
623
+ ## Related info
624
+
625
+ - [Testing Vue web applications with Vuex data store & REST backend](https://www.cypress.io/blog/2017/11/28/testing-vue-web-application-with-vuex-data-store-and-rest-backend/)
626
+ - [Why Cypress?](https://on.cypress.io/why-cypress)
627
+ - [Cypress API](https://on.cypress.io/api)
628
+ - [Learn TDD in Vue](https://learntdd.in/vue)
629
+ - [@cypress/vue vs vue-test-utils](https://codingitwrong.com/2018/03/04/comparing-vue-component-testing-tools.html)
630
+
631
+ ## Blog posts
632
+
633
+ - [Write Your First Vue Component Test](https://glebbahmutov.com/blog/first-vue-component-test/)
634
+
635
+ ## Test adapters for other frameworks
636
+
637
+ - [@cypress/react](https://github.com/cypress-io/@cypress/react)
638
+ - [cypress-cycle-unit-test](https://github.com/bahmutov/cypress-cycle-unit-test)
639
+ - [cypress-svelte-unit-test](https://github.com/bahmutov/cypress-svelte-unit-test)
640
+ - [@cypress/angular](https://github.com/bahmutov/@cypress/angular)
641
+ - [cypress-hyperapp-unit-test](https://github.com/bahmutov/cypress-hyperapp-unit-test)
642
+ - [cypress-angularjs-unit-test](https://github.com/bahmutov/cypress-angularjs-unit-test)
643
+
644
+ ## Maintainers
645
+
646
+ The Cypress.io Component Testing Team
647
+
648
+ - [Jessica Sachs](https://github.com/jessicasachs) (Current Maintainer, [Vue Test Utils](https://github.com/vuejs/vue-test-utils) Maintainer)
649
+ - [Lachlan Miller](https://github.com/lmiller1990) (Current Maintainer, [Vue Test Utils](https://github.com/vuejs/vue-test-utils) Maintainer)
650
+ - [Bart Ledoux](https://github.com/elevatebart) (Current Maintainer, [Vue Styleguidist](https://github.com/vue-styleguidist/vue-styleguidist) Maintainer)
651
+ - [Gleb Bahmutov](https://github.com/bahmutov) (Original Author, Current Maintainer of [@cypress/react](https://github.com//cypress-io/@cypress/react))
652
+
653
+ Support: if you find any problems with this module, [tweet](https://twitter.com/_jessicasachs) / [open issue](https://github.com/cypress-io/cypress/issues) on Github
654
+
655
+ ## License
656
+
657
+ [![license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/cypress-io/cypress/blob/master/LICENSE)
658
+
659
+ This project is licensed under the terms of the [MIT license](/LICENSE).
660
+
661
+ ## Changelog
662
+
663
+ [Changelog](./CHANGELOG.md)
664
+
665
+ ## Badges
666
+
667
+ Let the world know your project is using Cypress.io to test with this cool badge
668
+
669
+ [![Cypress.io](https://img.shields.io/badge/tested%20with-Cypress-04C38E.svg)](https://www.cypress.io/)
670
+
671
+ [npm-icon]: https://nodei.co/npm/@cypress/vue.svg?downloads=true
672
+ [npm-url]: https://npmjs.org/package/@cypress/vue
673
+ [cypress-vue2-npm-url]: https://www.npmjs.com/package/@cypress/vue2
674
+ [semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
675
+ [semantic-url]: https://github.com/semantic-release/semantic-release
676
+ [cypress-badge]: https://img.shields.io/badge/cypress.io-tests-green.svg?style=flat-square
677
+ [renovate-badge]: https://img.shields.io/badge/renovate-app-blue.svg
678
+ [renovate-app]: https://renovateapp.com/