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