Skip to content

Commit 05d8b69

Browse files
authored
Merge pull request #48 from eddyerburgh/dev
Docs update
2 parents 3cd8ba1 + 55852e0 commit 05d8b69

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+649
-191
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ Refer to [documentation](https://vuejs.github.io/vue-test-utils/)
1717
## Examples
1818

1919
- [example with Jest](https://github.com/eddyerburgh/vue-test-utils-jest-example)
20-
- [example with AVA](https://github.com/eddyerburgh/vue-test-utils-ava-example)
20+
- [example with Mocha](https://github.com/eddyerburgh/vue-test-utils-mocha-example)
2121
- [example with tape](https://github.com/eddyerburgh/vue-test-utils-tape-example)
22+
- [example with AVA](https://github.com/eddyerburgh/vue-test-utils-ava-example)
2223

2324
## Questions
2425

docs/en/README.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
1-
# vue-test-utils
1+
# Vue Test Utils
22

3-
vue-test-utils is the official test library for Vue.js. It provides methods for unit testing Vue components.
3+
Vue Test Utils is the official test library for Vue.js.
44

5-
[Documentation Summary](SUMMARY.md)
5+
It provides methods for [unit testing](guides/introduction-to-unit-tests.md) 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](guides/using-with-jest.md).
22+
23+
If you're new to unit testing, you can read our [introduction to unit tests](guides/introduction-to-unit-tests.md).
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)

docs/en/SUMMARY.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,12 @@
3636
* [setData](api/wrapper-array/setData.md)
3737
* [setProps](api/wrapper-array/setProps.md)
3838
* [trigger](api/wrapper-array/trigger.md)
39-
* [selectors](api/selectors.md)
40-
* [common gotchas](common-gotchas.md)
39+
* [Selectors](api/selectors.md)
40+
* [Guides](guides/README.md)
41+
* [Introduction to unit tests](guides/introduction-to-unit-tests.md)
42+
* [Choosing a test runner](guides/choosing-a-test-runner.md)
43+
* [Using with Jest](guides/using-with-jest.md)
44+
* [Testing SFCs with Jest](guides/testing-SFCs-with-jest.md)
45+
* [Testing SFCs with Mocha](guides/testing-SFCs-with-mocha-webpack.md)
46+
* [Using with Vuex](guides/using-with-vuex.md)
47+
* [Common gotchas](common-gotchas.md)

docs/en/api/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
## [mount](/docs/en/api/mount.md)
2-
## [shallow](/docs/en/api/shallow.md)
3-
## [selectors](/docs/en/api/selectors.md)
1+
# API
2+
3+
## [mount](api/mount.md)
4+
## [shallow](shallow.md)
5+
## [options](options.md)
6+
## [createLocalVue](createLocalVue.md)
7+
## [selectors](selectors.md)

docs/en/api/createLocalVue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ const freshWrapper = shallow(Foo)
2525
expect(freshWrapper.vm.foo).to.equal(false)
2626
```
2727

28-
- **See also:** [Common Gotchas](/en/common-gotchas.md)
28+
- **See also:** [Common Gotchas](common-gotchas.md)

docs/en/api/mount.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99

1010
- **Options:**
1111

12-
See [options](/docs/en/api/options.md)
12+
See [options](options.md)
1313

1414
- **Usage:**
1515

16-
Returns [`Wrapper`](/docs/en/api/wrapper/README.md) of first DOM node or Vue component matching selector.
16+
Returns [`Wrapper`](wrapper/README.md) of first DOM node or Vue component matching selector.
1717

18-
Use any valid [selector](/docs/en/api/selectors.md).
18+
Use any valid [selector](selectors.md).
1919

2020
**Without options:**
2121

@@ -133,4 +133,4 @@ describe('Foo', () => {
133133
})
134134
```
135135

136-
- **See also:** [Wrapper](/docs/en/api/wrapper/README.md)
136+
- **See also:** [Wrapper](wrapper/README.md)

docs/en/api/options.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Vue options are passed to the component when a new instance is created. , e.g. `
2222

2323
`options` (`Object`): a Vue options object. Vue options are passed to the component when a new instance is created. , e.g. `store`, `propsData`. For full list, see the [Vue API](https://vuejs.org/v2/api/). Also takes vue-test-utils options:
2424

25-
`options.attachToDocument` (`boolean`): Component will attach to DOM when rendered. This can be used with [`hasStyle`](/docs/en/api/wrapper/hasStyle.md) to check multi element CSS selectors
25+
`options.attachToDocument` (`boolean`): Component will attach to DOM when rendered. This can be used with [`hasStyle`](wrapper/hasStyle.md) to check multi element CSS selectors
2626

2727
`options.attrs` (`Object`): Attrs object to pass to component.
2828

@@ -34,7 +34,7 @@ Vue options are passed to the component when a new instance is created. , e.g. `
3434

3535
`options.intercept` (`Object`): Add globals to Vue instance.
3636

37-
`options.localVue` (`Object`): vue class to use in `mount`. See [createLocalVue](/docs/en/api/createLocalVue.md)
37+
`options.localVue` (`Object`): vue class to use in `mount`. See [createLocalVue](createLocalVue.md)
3838

3939
`options.propsData` (`Object`): Data for props in component
4040

docs/en/api/wrapper-array/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# WrapperArray
22

3-
A `WrapperArray` is an object that contains an array of [Wrappers](/docs/en/api/wrapper/README.md), and methods to test the `Wrappers`.
3+
A `WrapperArray` is an object that contains an array of [Wrappers](../wrapper/README.md), and methods to test the `Wrappers`.
44

55
- **Properties:**
66

docs/en/api/wrapper-array/at.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# at(index)
22

3+
- **Usage:**
4+
5+
Returns `Wrapper` at `index` passed. Uses zero based numbering (i.e. first item is at index 0).
6+
37
- **Arguments:**
48
- `{number} index`
59

610
- **Returns:** `{Wrapper}`
711

8-
- **Usage:**
9-
10-
Returns `Wrapper` at `index` passed. Uses zero based numbering (i.e. first item is at index 0).
12+
- **Example:**
1113

1214
```js
1315
import { shallow } from 'vue-test-utils'

docs/en/api/wrapper-array/contains.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
# contains(selector)
22

3+
- **Usage:**
4+
5+
Assert every wrapper in `WrapperArray` contains selector.
6+
7+
Use any valid [selector](../selectors.md).
8+
39
- **Arguments:**
410
- `{string|Component} selector`
511

612
- **Returns:** `{boolean}`
713

8-
- **Usage:**
9-
10-
Assert every wrapper in `WrapperArray` contains selector.
11-
12-
Use any valid [selector](/docs/en/api/selectors.md).
14+
- **Example:**
1315

1416
```js
1517
import { shallow } from 'vue-test-utils'

0 commit comments

Comments
 (0)