Skip to content

docs: move to VuePress #627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
steps:
- checkout
- *restore_node_modules
- run:
name: remove vuepress from dependencies
command: sed -i '/vuepress/ d' package.json
- run:
name: yarn --version
command: yarn --version
Expand Down
25 changes: 0 additions & 25 deletions RELEASE_NOTE_1.0.0-beta.16.md

This file was deleted.

26 changes: 26 additions & 0 deletions docs/.vuepress/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/en/* /:splat

/api/mount /api/#mount
/api/shallowMount /api/#shallowmount
/api/createLocalVue /api/#createlocalvue
/api/config /api/#config

/api/wrapper/* /api/wrapper.html/#:splat
/api/wrapper-array/* /api/wrapper-array.html/#:splat

/ja/api/mount /ja/api/#mount
/ja/api/shallowMount /ja/api/#shallowmount
/ja/api/createLocalVue /ja/api/#createlocalvue
/ja/api/config /ja/api/#config

/ja/api/wrapper/* /ja/api/wrapper.html/#:splat
/ja/api/wrapper/* /ja/api/wrapper.html/#:splat
/ja/api/wrapper-array/* /ja/api/wrapper-array.html/#:splat

/zh/api/mount /zh/api/#mount
/zh/api/shallowMount /zh/api/#shallowmount
/zh/api/createLocalVue /zh/api/#createlocalvue
/zh/api/config /zh/api/#config

/zh/api/wrapper/* /zh/api/wrapper.html/#:splat
/zh/api/wrapper-array/* /zh/api/wrapper-array.html/#:splat
105 changes: 105 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
module.exports = {
locales: {
'/': {
lang: 'en-US',
title: 'Vue Test Utils',
description: 'Utilities for testing Vue components'
},
'/ja/': {
lang: 'ja',
title: 'Vue Test Utils',
description: 'Vue コンポーネントをテストするためのユーティリティ'
},
'/zh/': {
lang: 'zh-CN',
title: 'Vue Test Utils',
description: '测试 Vue 组件的实用工具'
}
},
serviceWorker: true,
theme: 'vue',
themeConfig: {
repo: 'vuejs/vue-test-utils',
docsDir: 'docs',
locales: {
'/': {
label: 'English',
selectText: 'Languages',
editLinkText: 'Edit this page on GitHub',
nav: [
{
text: 'API',
link: '/api/'
},
{
text: 'Guides',
link: '/guides/'
}
],
sidebar: [
'/',
'/guides/',
'/api/',
'/api/wrapper/',
'/api/wrapper-array/',
'/api/options',
'/api/components/'
]
},
'/zh/': {
label: '简体中文',
selectText: '选择语言',
editLinkText: '在 GitHub 上编辑此页',
nav: [
{
text: 'API',
link: '/zh/api/'
},
{
text: '教程',
link: '/zh/guides/'
}
],
sidebar: [
'/zh/',
'/zh/guides/',
'/zh/api/',
'/zh/api/wrapper/',
'/zh/api/wrapper-array/',
'/zh/api/options',
'/zh/api/components/'
]
},
'/ja/': {
label: '日本語',
selectText: '言語',
editLinkText: 'GitHub 上でこのページを編集する',
nav: [
{
text: 'API',
link: '/ja/api/'
},
{
text: 'ガイド',
link: '/ja/guides/'
}
],
sidebar: [
'/ja/',
'/ja/guides/',
'/ja/api/',
'/ja/api/wrapper/',
'/ja/api/wrapper-array/',
'/ja/api/options',
'/ja/api/components/'
]
}
}
},
markdown: {
config: md => {
// use more markdown-it plugins!
md.use(require('markdown-it-include'))
}
}
}
7 changes: 0 additions & 7 deletions docs/LANGS.md

This file was deleted.

8 changes: 3 additions & 5 deletions docs/en/README.md → docs/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Vue Test Utils
# Introduction

Vue Test Utils is the official unit testing utility library for Vue.js.

## Table of Contents

* [Guides](guides/README.md)
* [Getting Started](guides/getting-started.md)
* [Guides](./guides/README.md)
* [Getting Started](./guides/getting-started.md)
* [Common Tips](guides/common-tips.md)
* [Mouse, Key and other DOM Events](guides/dom-events.md)
* [Choosing a test runner](guides/choosing-a-test-runner.md)
Expand Down
9 changes: 9 additions & 0 deletions docs/api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# API

!!!include(docs/api/mount.md)!!!
!!!include(docs/api/shallowMount.md)!!!
!!!include(docs/api/render.md)!!!
!!!include(docs/api/renderToString.md)!!!
!!!include(docs/api/selectors.md)!!!
!!!include(docs/api/createLocalVue.md)!!!
!!!include(docs/api/config.md)!!!
7 changes: 7 additions & 0 deletions docs/api/components/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Components

Vue Test Utils includes utility components you can use to stub components.

!!!include(docs/api/components/RouterLinkStub.md)!!!
!!!include(docs/api/components/TransitionStub.md)!!!
!!!include(docs/api/components/TransitionGroupStub.md)!!!
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `RouterLinkStub`
## RouterLinkStub

A component to stub the Vue Router `router-link` component.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `TransitionGroupStub`
## TransitionGroupStub

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

Expand Down Expand Up @@ -28,4 +28,4 @@ mount(Component, {
'transition-group': TransitionGroupStub
}
})
```
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `TransitionStub`
## TransitionStub

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

Expand Down
4 changes: 2 additions & 2 deletions docs/en/api/config.md → docs/api/config.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Config
## Config

Vue Test Utils includes a config object to defined options used by Vue Test Utils.

## Vue Test Utils Config Options
### Vue Test Utils Config Options

### `stubs`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `createLocalVue()`
## createLocalVue()

- **Returns:**
- `{Component}`
Expand Down
2 changes: 1 addition & 1 deletion docs/en/api/mount.md → docs/api/mount.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `mount(component [, options])`
## mount()

- **Arguments:**

Expand Down
26 changes: 12 additions & 14 deletions docs/en/api/options.md → docs/api/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

Options for `mount` and `shallowMount`. The options object can contain both Vue Test Utils mounting options and other options.

## Vue Test Utils Specific Mounting Options

- [`context`](#context)
- [`slots`](#slots)
- [`scopedSlots`](#scopedslots)
Expand All @@ -16,7 +14,7 @@ Options for `mount` and `shallowMount`. The options object can contain both Vue
- [`provide`](#provide)
- [`sync`](#sync)

### `context`
## context

- type: `Object`

Expand All @@ -38,7 +36,7 @@ const wrapper = mount(Component, {
expect(wrapper.is(Component)).toBe(true)
```

### `slots`
## slots

- type: `{ [name: string]: Array<Component>|Component|string }`

Expand All @@ -61,15 +59,15 @@ const wrapper = shallowMount(Component, {
expect(wrapper.find('div')).toBe(true)
```

#### Passing text
### Passing text

You can pass text to `slots`.
There is a limitation to this.

This does not support PhantomJS.
You can use [Puppeteer](https://github.com/karma-runner/karma-chrome-launcher#headless-chromium-with-puppeteer) as an alternative.

### `scopedSlots`
## scopedSlots

- type: `{ [name: string]: string }`

Expand All @@ -95,7 +93,7 @@ const wrapper = shallowMount(Component, {
expect(wrapper.find('#fooWrapper').html()).toBe('<div id="fooWrapper"><p>0,text1</p><p>1,text2</p><p>2,text3</p></div>')
```

### `stubs`
## stubs

- type: `{ [name: string]: Component | boolean } | Array<string>`

Expand All @@ -120,7 +118,7 @@ shallowMount(Component, {
})
```

### `mocks`
## mocks

- type: `Object`

Expand All @@ -138,7 +136,7 @@ const wrapper = shallowMount(Component, {
expect(wrapper.vm.$route.path).toBe($route.path)
```

### `localVue`
## localVue

- type: `Vue`

Expand Down Expand Up @@ -169,32 +167,32 @@ const wrapper = mount(Component, {
expect(wrapper.vm.$route).toBeInstanceOf(Object)
```

### `attachToDocument`
## attachToDocument

- type: `boolean`
- default: `false`

Component will be attached to DOM when rendered if set to `true`.

### `attrs`
## attrs

- type: `Object`

Set the component instance's `$attrs` object.

### `listeners`
## listeners

- type: `Object`

Set the component instance's `$listeners` object.

### `provide`
## provide

- type: `Object`

Pass properties for components to use in injection. See [provide/inject](https://vuejs.org/v2/api/#provide-inject).

### `sync`
## sync

- type: `boolean`
- default: `true`
Expand Down
2 changes: 1 addition & 1 deletion docs/en/api/render.md → docs/api/render.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `render(component [, options])`
## render()

- **Arguments:**

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `renderToString(component [, options])`
## renderToString()

- **Arguments:**

Expand Down
Loading