File tree 1 file changed +30
-0
lines changed 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 3
3
vue-test-utils is the official test library for Vue.js.
4
4
5
5
It provides methods for unit testing Vue components.
6
+
7
+ ## Example
8
+
9
+ ``` js
10
+ import { mount } from ' vue-test-utils'
11
+ import Counter from ' ./Counter.vue'
12
+
13
+ const wrapper = mount (Counter)
14
+ wrapper .find (' button' ).trigger (' click' )
15
+ expect (wrapper .text ()).toContain (' 1' )
16
+ ```
17
+
18
+
19
+ ## Getting started
20
+
21
+ To get started using Vue Test Utils, please see [ using with jest] ( ) .
22
+
23
+ If you're new to unit testing, please read our [ introduction to unit tests] ( ) .
24
+
25
+ ## Testing single file components (SFCs)
26
+
27
+ - [ Testing SFCs with Jest] ( guides/testing-SFCs-with-jest.md )
28
+ - [ Testing SFCs with Mocha] ( guides/testing-SFCs-with-mocha-webpack.md )
29
+
30
+ ## Example projects
31
+
32
+ - [ example with Jest] ( https://github.com/eddyerburgh/vue-test-utils-jest-example )
33
+ - [ example with Mocha] ( https://github.com/eddyerburgh/vue-test-utils-mocha-example )
34
+ - [ example with tape] ( https://github.com/eddyerburgh/vue-test-utils-tape-example )
35
+ - [ example with AVA] ( https://github.com/eddyerburgh/vue-test-utils-ava-example )
You can’t perform that action at this time.
0 commit comments