Skip to content

Commit 2b078c6

Browse files
Jinjiangeddyerburgh
authored andcommitted
docs: vue-test-utils -> Vue Test Utils (#443)
* [docs] standardized the name into title case * [docs][zh-cn] standardized the name into title case * [docs][zh-cn] standardized the name into title case
1 parent 87c58fb commit 2b078c6

32 files changed

+60
-60
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# vue-test-utils [![Build Status](https://circleci.com/gh/vuejs/vue-test-utils/tree/dev.png?style=shield)](https://circleci.com/gh/vuejs/vue-test-utils)
1+
# Vue Test Utils [![Build Status](https://circleci.com/gh/vuejs/vue-test-utils/tree/dev.png?style=shield)](https://circleci.com/gh/vuejs/vue-test-utils)
22

33
## Currently in beta
4-
To use vue-test-utils beta:
4+
To use Vue Test Utils beta:
55
```
66
// npm
77
npm install --save-dev @vue/test-utils
@@ -12,7 +12,7 @@ yarn add --dev @vue/test-utils
1212

1313
## Intro
1414

15-
`vue-test-utils` is the official test library for [Vue.js](http://vuejs.org). It provides methods for unit testing Vue components.
15+
Vue Test Utils is the official test library for [Vue.js](http://vuejs.org). It provides methods for unit testing Vue components.
1616

1717
## Documentation
1818

docs/en/README.md

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

3-
`vue-test-utils` is the official unit testing utility library for Vue.js.
3+
Vue Test Utils is the official unit testing utility library for Vue.js.
44

55
## Table of Contents
66

docs/en/api/components/README.md

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

3-
vue-test-utils includes utility components you can use to stub components.
3+
Vue Test Utils includes utility components you can use to stub components.
44

55
[TransitionStub](./TransitionStub.md) and [TransitionGroupStub](./TransitionGroupStub.md) are used to stub `transition` and `transition-group` components by default. You can edit the stubs by editing the config.

docs/en/api/components/TransitionGroupStub.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A component to stub the `transition-group` component. Instead of performing transitions asynchronously, it returns the child components synchronously.
44

5-
This is set to stub all `transition-group` components by default in the `vue-test-utils` config. To use the built-in `transition-group` component set `config.stubs['transition-group']` to false:
5+
This is set to stub all `transition-group` components by default in the Vue Test Utils config. To use the built-in `transition-group` component set `config.stubs['transition-group']` to false:
66

77
```js
88
import { config } from '@vue/test-utils'

docs/en/api/components/TransitionStub.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A component to stub the `transition` component. Instead of performing transitions asynchronously, it returns the child component synchronously.
44

5-
This is set to stub all `transition` components by default in the vue-test-utils config. To use the built-in `transition` component set `config.stubs.transition` to false:
5+
This is set to stub all `transition` components by default in the Vue Test Utils config. To use the built-in `transition` component set `config.stubs.transition` to false:
66

77
```js
88
import { config } from '@vue/test-utils'

docs/en/api/config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Config
22

3-
vue-test-utils includes a config object to defined options used by vue-test-utils.
3+
Vue Test Utils includes a config object to defined options used by Vue Test Utils.
44

5-
## `vue-test-utils` Config Options
5+
## Vue Test Utils Config Options
66

77
### `stubs`
88

docs/en/api/options.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Mounting Options
22

3-
Options for `mount` and `shallow`. The options object can contain both `vue-test-utils` mounting options and other options.
3+
Options for `mount` and `shallow`. The options object can contain both Vue Test Utils mounting options and other options.
44

5-
## `vue-test-utils` Specific Mounting Options
5+
## Vue Test Utils Specific Mounting Options
66

77
- [`context`](#context)
88
- [`slots`](#slots)

docs/en/api/selectors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ expect(wrapper.is(Foo)).toBe(true)
4343

4444
### Name
4545

46-
Using a find option object, `vue-test-utils` allows for selecting elements by a `name` of component on wrapper components.
46+
Using a find option object, Vue Test Utils allows for selecting elements by a `name` of component on wrapper components.
4747

4848
```js
4949
const buttonWrapper = wrapper.find({ name: 'my-button' })
@@ -52,7 +52,7 @@ buttonWrapper.trigger('click')
5252

5353
### Ref
5454

55-
Using a find option object, `vue-test-utils` allows for selecting elements by `$ref` on wrapper components.
55+
Using a find option object, Vue Test Utils allows for selecting elements by `$ref` on wrapper components.
5656

5757
```js
5858
const buttonWrapper = wrapper.find({ ref: 'myButton' })

docs/en/api/wrapper/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# `Wrapper`
22

3-
`vue-test-utils` is a wrapper based API.
3+
Vue Test Utils is a wrapper based API.
44

55
A `Wrapper` is an object that contains a mounted component or vnode and methods to test the component or vnode.
66

77
- **Properties:**
88

99
`vm` `Component`: this is the `Vue` instance. You can access all the [instance methods and properties of a vm](https://vuejs.org/v2/api/#Instance-Properties) with `wrapper.vm`. This only exists on Vue component wrappers
1010
`element` `HTMLElement`: the root DOM node of the wrapper
11-
`options` `Object`: Object containing `vue-test-utils` options passed to `mount` or `shallow`
11+
`options` `Object`: Object containing Vue Test Utils options passed to `mount` or `shallow`
1212
`options.attachedToDom` `Boolean`: True if `attachToDom` was passed to `mount` or `shallow`
1313

1414
- **Methods:**

docs/en/guides/choosing-a-test-runner.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A test runner is a program that runs tests.
44

5-
There are many popular JavaScript test runners, and `vue-test-utils` works with all of them. It's test runner agnostic.
5+
There are many popular JavaScript test runners, and Vue Test Utils works with all of them. It's test runner agnostic.
66

77
There are a few things to consider when choosing a test runner though: feature set, performance, and support for single-file component (SFC) pre-compilation. After carefully comparing existing libraries, here are two test runners that we recommend:
88

@@ -12,7 +12,7 @@ There are a few things to consider when choosing a test runner though: feature s
1212

1313
## Browser Environment
1414

15-
`vue-test-utils` relies on a browser environment. Technically you can run it in a real browser, but it's not recommended due to the complexity of launching real browsers on different platforms. Instead, we recommend running the tests in Node with a virtual browser environment using [JSDOM](https://github.com/tmpvar/jsdom).
15+
Vue Test Utils relies on a browser environment. Technically you can run it in a real browser, but it's not recommended due to the complexity of launching real browsers on different platforms. Instead, we recommend running the tests in Node with a virtual browser environment using [JSDOM](https://github.com/tmpvar/jsdom).
1616

1717
The Jest test runner sets up JSDOM automatically. For other test runners, you can manually set up JSDOM for the tests using [jsdom-global](https://github.com/rstacruz/jsdom-global) in the entry for your tests:
1818

docs/en/guides/common-tips.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ In unit tests, we typically want to focus on the component being tested as an is
1818

1919
In addition, for components that contain many child components, the entire rendered tree can get really big. Repeatedly rendering all child components could slow down our tests.
2020

21-
`vue-test-utils` allows you to mount a component without rendering its child components (by stubbing them) with the `shallow` method:
21+
Vue Test Utils allows you to mount a component without rendering its child components (by stubbing them) with the `shallow` method:
2222

2323
```js
2424
import { shallow } from '@vue/test-utils'

docs/en/guides/dom-events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,4 +209,4 @@ A key name after the dot `keydown.up` is translated to a `keyCode`. This is supp
209209

210210
## Important
211211

212-
`vue-test-utils` triggers event synchronously. Consequently, `Vue.nextTick` is not required.
212+
Vue Test Utils triggers event synchronously. Consequently, `Vue.nextTick` is not required.

docs/en/guides/getting-started.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Setup
44

5-
To get a quick taste of using `vue-test-utils`, clone our demo repository with basic setup and install the dependencies:
5+
To get a quick taste of using Vue Test Utils, clone our demo repository with basic setup and install the dependencies:
66

77
``` bash
88
git clone https://github.com/vuejs/vue-test-utils-getting-started
@@ -39,7 +39,7 @@ export default {
3939

4040
### Mounting Components
4141

42-
`vue-test-utils` tests Vue components by mounting them in isolation, mocking the necessary inputs (props, injections and user events) and asserting the outputs (render result, emitted custom events).
42+
Vue Test Utils tests Vue components by mounting them in isolation, mocking the necessary inputs (props, injections and user events) and asserting the outputs (render result, emitted custom events).
4343

4444
Mounted components are returned inside a [Wrapper](./api/wrapper.md), which exposes many convenience methods for manipulating, traversing and querying the underlying Vue component instance.
4545

@@ -60,7 +60,7 @@ const wrapper = mount(Counter)
6060
const vm = wrapper.vm
6161

6262
// To inspect the wrapper deeper just log it to the console
63-
// and your adventure with the `vue-test-utils` begins
63+
// and your adventure with the Vue Test Utils begins
6464
console.log(wrapper)
6565
```
6666

@@ -106,7 +106,7 @@ it('button click should increment the count', () => {
106106

107107
Vue batches pending DOM updates and applies them asynchronously to prevent unnecessary re-renders caused by multiple data mutations. This is why in practice we often have to use `Vue.nextTick` to wait until Vue has performed the actual DOM update after we trigger some state change.
108108

109-
To simplify usage, `vue-test-utils` applies all updates synchronously so you don't need to use `Vue.nextTick` to wait for DOM updates in your tests.
109+
To simplify usage, Vue Test Utils applies all updates synchronously so you don't need to use `Vue.nextTick` to wait for DOM updates in your tests.
110110

111111
*Note: `nextTick` is still necessary when you need to explictly advance the event loop, for operations such as asynchronous callbacks or promise resolution.*
112112

@@ -140,5 +140,5 @@ it('will catch the error using a promise', () => {
140140

141141
## What's Next
142142

143-
- Integrate `vue-test-utils` into your project by [choosing a test runner](./choosing-a-test-runner.md).
143+
- Integrate Vue Test Utils into your project by [choosing a test runner](./choosing-a-test-runner.md).
144144
- Learn more about [common techniques when writing tests](./common-tips.md).

docs/en/guides/testing-SFCs-with-jest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Jest is a test runner developed by Facebook, aiming to deliver a battery-include
88

99
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`.
1010

11-
The first thing to do is install Jest and `vue-test-utils`:
11+
The first thing to do is install Jest and Vue Test Utils:
1212

1313
```bash
1414
$ npm install --save-dev jest @vue/test-utils

docs/en/guides/testing-SFCs-with-mocha-webpack.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ module.exports = {
7878

7979
### Setting Up Browser Environment
8080

81-
`vue-test-utils` requires a browser environment to run. We can simulate it in Node using `jsdom-global`:
81+
Vue Test Utils requires a browser environment to run. We can simulate it in Node using `jsdom-global`:
8282

8383
```bash
8484
npm install --save-dev jsdom jsdom-global
@@ -90,7 +90,7 @@ Then in `test/setup.js`:
9090
require('jsdom-global')()
9191
```
9292

93-
This adds a browser environment to Node, so that `vue-test-utils` can run correctly.
93+
This adds a browser environment to Node, so that Vue Test Utils can run correctly.
9494

9595
### Picking an Assertion Library
9696

docs/en/guides/testing-async-components.md

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

3-
To simplify testing, `vue-test-utils` applies DOM updates _synchronously_. However, there are some techniques you need to be aware of when testing a component with asynchronous behavior such as callbacks or promises.
3+
To simplify testing, Vue Test Utils applies DOM updates _synchronously_. However, there are some techniques you need to be aware of when testing a component with asynchronous behavior such as callbacks or promises.
44

55
One of the most common asynchronous behaviors is API calls and Vuex actions. The following examples shows how to test a method that makes an API call. This example uses Jest to run the test and to mock the HTTP library `axios`. More about Jest manual mocks can be found [here](https://facebook.github.io/jest/docs/en/manual-mocks.html#content).
66

docs/en/guides/using-with-vuex.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Using with Vuex
22

3-
In this guide, we'll see how to test Vuex in components with `vue-test-utils`, and how to approach testing a Vuex store.
3+
In this guide, we'll see how to test Vuex in components with Vue Test Utils, and how to approach testing a Vuex store.
44

55
## Testing Vuex in components
66

@@ -105,7 +105,7 @@ Now the way we define the store might look a bit foreign to you.
105105

106106
We’re using `beforeEach` to ensure we have a clean store before each test. `beforeEach` is a mocha hook that’s called before each test. In our test, we are reassigning the store variables value. If we didn’t do this, the mock functions would need to be automatically reset. It also lets us change the state in our tests, without it affecting later tests.
107107

108-
The most important thing to note in this test is that **we create a mock Vuex store and then pass it to `vue-test-utils`**.
108+
The most important thing to note in this test is that **we create a mock Vuex store and then pass it to Vue Test Utils**.
109109

110110
Great, so now we can mock actions, let’s look at mocking getters.
111111

@@ -285,7 +285,7 @@ export default {
285285

286286
### Testing getters, mutations, and actions separately
287287

288-
Getters, mutations, and actions are all JavaScript functions, so we can test them without using `vue-test-utils` and Vuex.
288+
Getters, mutations, and actions are all JavaScript functions, so we can test them without using Vue Test Utils and Vuex.
289289

290290
The benefit to testing getters, mutations, and actions separately is that your unit tests are detailed. When they fail, you know exactly what is wrong with your code. The downside is that you will need to mock Vuex funtions, like `commit` and `dispatch`. This can lead to a situation where your unit tests pass, but your production code fails because your mocks are incorrect.
291291

docs/zh-cn/README.md

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

3-
`vue-test-utils` 是 Vue.js 官方的单元测试实用工具库。
3+
Vue Test Utils 是 Vue.js 官方的单元测试实用工具库。
44

55
## 目录
66

docs/zh-cn/api/components/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# 组件
22

3-
`vue-test-utils` 包含了用做存根的实用组件。
3+
Vue Test Utils 包含了用做存根的实用组件。
44

55
默认情况下 [TransitionStub](./TransitionStub.md)[TransitionGroupStub](./TransitionGroupStub.md) 用来存根 `transition``transition-group` 组件。你也可以通过配置信息来编辑存根。

docs/zh-cn/api/components/TransitionGroupStub.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
一个用来存根 `transition-group` 组件的组件。与其异步完成过渡动画不同的是,它会同步返回子组件。
44

5-
它在 `vue-test-utils` 默认配置中用来存根所有的 `transition-group` 组件。将 `config.stubs['transition-group']` 设为 `false` 可以使用内建的 `transition-group` 组件:
5+
它在 Vue Test Utils 默认配置中用来存根所有的 `transition-group` 组件。将 `config.stubs['transition-group']` 设为 `false` 可以使用内建的 `transition-group` 组件:
66

77
```js
88
import { config } from '@vue/test-utils'

docs/zh-cn/api/components/TransitionStub.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
一个用来存根 `transition` 组件的组件。与其异步完成过渡动画不同的是,它会同步返回子组件。
44

5-
它在 `vue-test-utils` 默认配置中用来存根所有的 `transition` 组件。将 `config.stubs.transition` 设为 `false` 可以使用内建的 `transition` 组件:
5+
它在 Vue Test Utils 默认配置中用来存根所有的 `transition` 组件。将 `config.stubs.transition` 设为 `false` 可以使用内建的 `transition` 组件:
66

77

88
```js

docs/zh-cn/api/config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# 配置
22

3-
`vue-test-utils` 包含了一个定义其选项的配置对象。
3+
Vue Test Utils 包含了一个定义其选项的配置对象。
44

5-
## `vue-test-utils` 配置选项
5+
## Vue Test Utils 配置选项
66

77
### `stubs`
88

docs/zh-cn/api/options.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# 挂载选项
22

3-
`mount``shallow` 的选项。该对象同时包含了 `vue-test-utils` 挂载选项和其它选项。
3+
`mount``shallow` 的选项。该对象同时包含了 Vue Test Utils 挂载选项和其它选项。
44

5-
## `vue-test-utils` 特定的挂载选项
5+
## Vue Test Utils 特定的挂载选项
66

77
- [`context`](#context)
88
- [`slots`](#slots)

docs/zh-cn/api/selectors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ expect(wrapper.is(Foo)).toBe(true)
4343

4444
### Name
4545

46-
`vue-test-utils` 允许通过一个查找选项对象在组件包裹器上根据一个组件的 `name` 选择元素。
46+
Vue Test Utils 允许通过一个查找选项对象在组件包裹器上根据一个组件的 `name` 选择元素。
4747

4848

4949
```js
@@ -53,7 +53,7 @@ buttonWrapper.trigger('click')
5353

5454
### Ref
5555

56-
`vue-test-utils` 允许通过一个查找选项对象在组件包裹器上根据 `$ref` 选择元素。
56+
Vue Test Utils 允许通过一个查找选项对象在组件包裹器上根据 `$ref` 选择元素。
5757

5858
```js
5959
const buttonWrapper = wrapper.find({ ref: 'myButton' })

docs/zh-cn/api/wrapper/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# `Wrapper`
22

3-
`vue-test-utils` 是一个基于包裹器的 API。
3+
Vue Test Utils 是一个基于包裹器的 API。
44

55
一个 `Wrapper` 是一个包括了一个挂载组件或 vnode,以及测试该组件或 vnode 的方法。
66

77
- **属性:**
88

99
`vm` `Component`:这是该 Vue 实例。你可以通过 `wrapper.vm` 访问一个实例所有的[方法和属性](https://vuejs.org/v2/api/#Instance-Properties)。这只存在于 Vue 组件包裹器中
1010
`element` `HTMLElement`:包裹器的根 DOM 节点
11-
`options` `Object`:一个对象,包含传递给 `mount``shallow``vue-test-utils` 选项
11+
`options` `Object`:一个对象,包含传递给 `mount``shallow`Vue Test Utils 选项
1212
`options.attachedToDom` `Boolean`:如果 `attachToDom` 传递给了 `mount``shallow` 则为真
1313

1414
- **方法:**

docs/zh-cn/guides/choosing-a-test-runner.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
测试运行器 (test runner) 就是运行测试的程序。
44

5-
主流的 JavaScript 测试运行器有很多,但 `vue-test-utils` 都能够支持。它是测试运行器无关的。
5+
主流的 JavaScript 测试运行器有很多,但 Vue Test Utils 都能够支持。它是测试运行器无关的。
66

77
当然在我们选用测试运行器的时候也需要考虑一些事项:功能集合、性能和对单文件组件预编译的支持等。在仔细比对现有的库之后,我们推荐其中的两个测试运行器:
88

@@ -12,7 +12,7 @@
1212

1313
## 浏览器环境
1414

15-
`vue-test-utils` 依赖浏览器环境。技术上讲你可以将其运行在一个真实的浏览器,但是我们并不推荐,因为在不同的平台上都启动真实的浏览器是很复杂的。我们推荐取而代之的是用 [JSDOM](https://github.com/tmpvar/jsdom) 在 Node 虚拟浏览器环境运行测试。
15+
Vue Test Utils 依赖浏览器环境。技术上讲你可以将其运行在一个真实的浏览器,但是我们并不推荐,因为在不同的平台上都启动真实的浏览器是很复杂的。我们推荐取而代之的是用 [JSDOM](https://github.com/tmpvar/jsdom) 在 Node 虚拟浏览器环境运行测试。
1616

1717
Jest 测试运行器自动设置了 JSDOM。对于其它测试运行器来说,你可以在你的测试入口处使用 [jsdom-global](https://github.com/rstacruz/jsdom-global) 手动设置 JSDOM。
1818

docs/zh-cn/guides/common-tips.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
额外的,对于包含许多子组件的组件来说,整个渲染树可能会非常大。重复渲染所有的子组件可能会让我们的测试变慢。
2020

21-
`vue-test-utils` 允许你通过 `shallow` 方法只挂载一个组件而不渲染其子组件 (即保留它们的存根):
21+
Vue Test Utils 允许你通过 `shallow` 方法只挂载一个组件而不渲染其子组件 (即保留它们的存根):
2222

2323
```js
2424
import { shallow } from '@vue/test-utils'

docs/zh-cn/guides/dom-events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,4 +209,4 @@ describe('键盘事件测试', () => {
209209

210210
## 重要事项
211211

212-
`vue-test-utils` 是同步触发事件。因此 `Vue.nextTick` 不是必须的。
212+
Vue Test Utils 是同步触发事件。因此 `Vue.nextTick` 不是必须的。

0 commit comments

Comments
 (0)