Skip to content

[WIP]Translate docs into ja #58

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

Closed
wants to merge 53 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
758fe1a
setup japanese translation
sunecosuri Sep 30, 2017
2f80a9d
translate README.md
sunecosuri Sep 30, 2017
1f96747
translate SUMMARY.md
sunecosuri Sep 30, 2017
8ac951c
translate getting-started.md
sunecosuri Sep 30, 2017
da44ca6
translate common-gotchas.md
sunecosuri Sep 30, 2017
91cbc3b
update getting-started.md
sunecosuri Sep 30, 2017
7add2ad
translate /api/wrapper/README.md
sunecosuri Sep 30, 2017
22158e6
update /api/wrapper/README.md
sunecosuri Sep 30, 2017
0580829
translate /api/README.md
sunecosuri Sep 30, 2017
5f7731a
translate /api/wrapper/contains.md
sunecosuri Sep 30, 2017
de84423
translate /api/wrapper/exist.md
sunecosuri Sep 30, 2017
b58fa22
translate /api/wrapper/find.md
sunecosuri Sep 30, 2017
f97f164
translate /api/wrapper/findAll.md
sunecosuri Sep 30, 2017
aa44330
translate /api/wrapper/hasAttribute.md
sunecosuri Sep 30, 2017
b49efd2
translate /api/wrapper/hasClass.md
sunecosuri Sep 30, 2017
f53c65d
translate /api/wrapper/hasProp.md
sunecosuri Sep 30, 2017
c3ea516
translate /api/wrapper/hasStyle.md
sunecosuri Sep 30, 2017
4fcdf86
update /api/wrapper/hasProp.md
sunecosuri Sep 30, 2017
4df04f0
translate /api/wrapper/html.md
sunecosuri Sep 30, 2017
94c32c3
translate /api/wrapper/is.md:
sunecosuri Sep 30, 2017
bf58996
translate api/wrapper/isEmpty.md
sunecosuri Sep 30, 2017
d85003f
translate /api/wrapper/isVueInstance.md
sunecosuri Sep 30, 2017
e89dcbe
translate /api/wrapper/setData.md
sunecosuri Sep 30, 2017
8abe209
translate /api/wrapper/setData.md
sunecosuri Sep 30, 2017
3255e9d
translate /api/wrapper/setMethods.md
sunecosuri Sep 30, 2017
44b99c0
translate /api/wrapper/setProps.md
sunecosuri Sep 30, 2017
86142ca
translate /api/wrapper/text.md
sunecosuri Sep 30, 2017
6b52578
translate /api/wrapper/trigger.md
sunecosuri Sep 30, 2017
c08e849
translate /api/wrapper/update.md
sunecosuri Sep 30, 2017
ab6a276
update common-gotchas.md
sunecosuri Oct 1, 2017
eabdd66
translate /api/createLocalVue.md
sunecosuri Oct 1, 2017
629b2b7
translate /api/mount.md
sunecosuri Oct 1, 2017
74beb46
improve japanese
Oct 2, 2017
8d30c66
translate /api/selectors.md
Oct 2, 2017
e2545d9
improve japanese
Oct 2, 2017
ca7db35
translate /api/wrapper-array/shallow.md
Oct 2, 2017
a1e8cae
translate /api/wrapper-array/README.md
Oct 2, 2017
126506b
translate api/wrapper-array/at.md
Oct 2, 2017
db15431
translate /api/wrapper-array/contains.md
Oct 2, 2017
2d772fc
translate /api/wrapper-array
Oct 2, 2017
50052e1
Merge branch 'dev' of github.com:vuejs/vue-test-utils into translate-ja
sunecosuri Oct 5, 2017
92e7e90
translate api/options.md
sunecosuri Oct 5, 2017
b88e003
improve README.md
sunecosuri Oct 5, 2017
2d999e8
improves api/options.md mount.md README.md
sunecosuri Oct 5, 2017
bf358d2
docs: fix small typo (#78)
miljan-aleksic Oct 6, 2017
1af67d8
bump docs theme
yyx990803 Oct 6, 2017
8e74bcd
docs: skip ci build
yyx990803 Oct 6, 2017
df1974a
docs: update example repo links (#80)
ankurk91 Oct 7, 2017
453e170
Merge branch 'translate-ja' of ssh://github.com/sunecosuri/vue-test-u…
sunecosuri Oct 7, 2017
7013e6b
improve ja docs
sunecosuri Oct 8, 2017
de4003e
translate docs/guides/
sunecosuri Oct 8, 2017
a881e50
improved to contents of feedback
sunecosuri Oct 8, 2017
c5b9360
`using-with-vuex` is does not translate to wait for updates
sunecosuri Oct 9, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Refer to [documentation](https://vue-test-utils.vuejs.org/)

## Examples

- [example with Jest](https://github.com/eddyerburgh/vue-test-utils-jest-example)
- [example with Mocha](https://github.com/eddyerburgh/vue-test-utils-mocha-example)
- [example with Jest](https://github.com/vuejs/vue-test-utils-jest-example)
- [example with Mocha](https://github.com/vuejs/vue-test-utils-mocha-webpack-example)
- [example with tape](https://github.com/eddyerburgh/vue-test-utils-tape-example)
- [example with AVA](https://github.com/eddyerburgh/vue-test-utils-ava-example)

Expand Down
4 changes: 4 additions & 0 deletions docs/assets/circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
general:
branches:
ignore:
- gh-pages
2 changes: 1 addition & 1 deletion docs/en/guides/testing-SFCs-with-jest.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Then configure it in `package.json`:

### Placing Test Files

By default, jest will recursively pick up all files that have a `.spec.js` or `.test.js` extension in the entire project. If this does not fit your needs, it's possible [to chang the testRegex](https://facebook.github.io/jest/docs/en/configuration.html#testregex-string) in the config section in the `package.json` file.
By default, jest will recursively pick up all files that have a `.spec.js` or `.test.js` extension in the entire project. If this does not fit your needs, it's possible [to change the testRegex](https://facebook.github.io/jest/docs/en/configuration.html#testregex-string) in the config section in the `package.json` file.

Jest recommends creating a `__tests__` directory right next to the code being tested, but feel free to structure your tests as you see fit. Just beware that Jest would create a `__snapshots__` directory next to test files that performs snapshot testing.

Expand Down
48 changes: 48 additions & 0 deletions docs/ja/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# vue-test-utils

`vue-test-utils`はVue.jsの公式テストライブラリです。 Vueコンポーネントの単体テスト方法を提供します。

* [Guides](guides/README.md)
* [Getting Started](guides/getting-started.md)
* [Common Tips](guides/common-tips.md)
* [Choosing a test runner](guides/choosing-a-test-runner.md)
* [Testing SFCs with Jest](guides/testing-SFCs-with-jest.md)
* [Testing SFCs with Mocha + webpack](guides/testing-SFCs-with-mocha-webpack.md)
* [Using with Vuex](guides/using-with-vuex.md)
* [API](api/README.md)
* [createLocalVue](api/createLocalVue.md)
* [mount](api/mount.md)
* [shallow](api/shallow.md)
* [Mounting Options](api/options.md)
* [Wrapper](api/wrapper/README.md)
* [contains](api/wrapper/contains.md)
* [find](api/wrapper/find.md)
* [hasAttribute](api/wrapper/hasAttribute.md)
* [hasClass](api/wrapper/hasClass.md)
* [hasProp](api/wrapper/hasProp.md)
* [hasStyle](api/wrapper/hasStyle.md)
* [html](api/wrapper/html.md)
* [is](api/wrapper/is.md)
* [isEmpty](api/wrapper/isEmpty.md)
* [isVueInstance](api/wrapper/isVueInstance.md)
* [name](api/wrapper/name.md)
* [update](api/wrapper/update.md)
* [setData](api/wrapper/setData.md)
* [setProps](api/wrapper/setProps.md)
* [text](api/wrapper/text.md)
* [trigger](api/wrapper/trigger.md)
* [WrapperArray](api/wrapper-array/README.md)
* [at](api/wrapper-array/at.md)
* [contains](api/wrapper-array/contains.md)
* [hasAttribute](api/wrapper-array/hasAttribute.md)
* [hasClass](api/wrapper-array/hasClass.md)
* [hasProp](api/wrapper-array/hasProp.md)
* [hasStyle](api/wrapper-array/hasStyle.md)
* [is](api/wrapper-array/is.md)
* [isEmpty](api/wrapper-array/isEmpty.md)
* [isVueInstance](api/wrapper-array/isVueInstance.md)
* [update](api/wrapper-array/update.md)
* [setData](api/wrapper-array/setData.md)
* [setProps](api/wrapper-array/setProps.md)
* [trigger](api/wrapper-array/trigger.md)
* [Selectors](api/selectors.md)
60 changes: 60 additions & 0 deletions docs/ja/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
## 目次

* [Guides](guides/README.md)
* [Getting Started](guides/getting-started.md)
* [Common Tips](guides/common-tips.md)
* [Choosing a test runner](guides/choosing-a-test-runner.md)
* [Testing SFCs with Jest](guides/testing-SFCs-with-jest.md)
* [Testing SFCs with Mocha + webpack](guides/testing-SFCs-with-mocha-webpack.md)
* [Using with Vuex](guides/using-with-vuex.md)
* [API](api/README.md)
* [mount](api/mount.md)
* [shallow](api/shallow.md)
* [Mounting Options](api/options.md)
- [context](api/options.md#context)
- [slots](api/options.md#slots)
- [stubs](api/options.md#stubs)
- [mocks](api/options.md#mocks)
- [localVue](api/options.md#localvue)
- [attachToDocument](api/options.md#attachtodocument)
- [attrs](api/options.md#attrs)
- [listeners](api/options.md#listeners)
- [clone](api/options.md#clone)
* [Wrapper](api/wrapper/README.md)
* [contains](api/wrapper/contains.md)
* [emitted](api/wrapper/emitted.md)
* [emittedByOrder](api/wrapper/emittedByOrder.md)
* [find](api/wrapper/find.md)
* [findAll](api/wrapper/findAll.md)
* [hasAttribute](api/wrapper/hasAttribute.md)
* [hasClass](api/wrapper/hasClass.md)
* [hasProp](api/wrapper/hasProp.md)
* [hasStyle](api/wrapper/hasStyle.md)
* [html](api/wrapper/html.md)
* [is](api/wrapper/is.md)
* [isEmpty](api/wrapper/isEmpty.md)
* [isVueInstance](api/wrapper/isVueInstance.md)
* [name](api/wrapper/name.md)
* [setData](api/wrapper/setData.md)
* [setMethods](api/wrapper/setMethods.md)
* [setProps](api/wrapper/setProps.md)
* [text](api/wrapper/text.md)
* [trigger](api/wrapper/trigger.md)
* [update](api/wrapper/update.md)
* [WrapperArray](api/wrapper-array/README.md)
* [at](api/wrapper-array/at.md)
* [contains](api/wrapper-array/contains.md)
* [hasAttribute](api/wrapper-array/hasAttribute.md)
* [hasClass](api/wrapper-array/hasClass.md)
* [hasProp](api/wrapper-array/hasProp.md)
* [hasStyle](api/wrapper-array/hasStyle.md)
* [is](api/wrapper-array/is.md)
* [isEmpty](api/wrapper-array/isEmpty.md)
* [isVueInstance](api/wrapper-array/isVueInstance.md)
* [setData](api/wrapper-array/setData.md)
* [setMethods](api/wrapper-array/setMethods.md)
* [setProps](api/wrapper-array/setProps.md)
* [trigger](api/wrapper-array/trigger.md)
* [update](api/wrapper-array/update.md)
* [Selectors](api/selectors.md)
* [createLocalVue](api/createLocalVue.md)
49 changes: 49 additions & 0 deletions docs/ja/api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# API

* [mount](./mount.md)
* [shallow](./shallow.md)
* [Mounting Options](./options.md)
- [context](./options.md#context)
- [slots](./options.md#slots)
- [stubs](./options.md#stubs)
- [mocks](./options.md#mocks)
- [localVue](./options.md#localvue)
- [attachToDocument](./options.md#attachtodocument)
- [attrs](./options.md#attrs)
- [listeners](./options.md#listeners)
- [clone](./options.md#clone)
* [Wrapper](./wrapper/README.md)
* [contains](./wrapper/contains.md)
* [emitted](./wrapper/emitted.md)
* [emittedByOrder](./wrapper/emittedByOrder.md)
* [find](./wrapper/find.md)
* [hasAttribute](./wrapper/hasAttribute.md)
* [hasClass](./wrapper/hasClass.md)
* [hasProp](./wrapper/hasProp.md)
* [hasStyle](./wrapper/hasStyle.md)
* [html](./wrapper/html.md)
* [is](./wrapper/is.md)
* [isEmpty](./wrapper/isEmpty.md)
* [isVueInstance](./wrapper/isVueInstance.md)
* [name](./wrapper/name.md)
* [update](./wrapper/update.md)
* [setData](./wrapper/setData.md)
* [setProps](./wrapper/setProps.md)
* [text](./wrapper/text.md)
* [trigger](./wrapper/trigger.md)
* [WrapperArray](./wrapper-array/README.md)
* [at](./wrapper-array/at.md)
* [contains](./wrapper-array/contains.md)
* [hasAttribute](./wrapper-array/hasAttribute.md)
* [hasClass](./wrapper-array/hasClass.md)
* [hasProp](./wrapper-array/hasProp.md)
* [hasStyle](./wrapper-array/hasStyle.md)
* [is](./wrapper-array/is.md)
* [isEmpty](./wrapper-array/isEmpty.md)
* [isVueInstance](./wrapper-array/isVueInstance.md)
* [update](./wrapper-array/update.md)
* [setData](./wrapper-array/setData.md)
* [setProps](./wrapper-array/setProps.md)
* [trigger](./wrapper-array/trigger.md)
* [createLocalVue](./createLocalVue.md)
* [Selectors](./selectors.md)
28 changes: 28 additions & 0 deletions docs/ja/api/createLocalVue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# createLocalVue()

- **戻り値:**
- `{Component}`

- **使い方:**

`createLocalVue`は、グローバルVueクラスを汚染することなくコンポーネント、ミックスイン、プラグインを追加するためのVueクラスを返します。

`options.localVue`と一緒に使用してください。

```js
import { createLocalVue, shallow } from 'vue-test-utils'
import { expect } from 'chai'
import Foo from './Foo.vue'

const localVue = createLocalVue()
const wrapper = shallow(Foo, {
localVue,
intercept: { foo: true }
})
expect(wrapper.vm.foo).to.equal(true)

const freshWrapper = shallow(Foo)
expect(freshWrapper.vm.foo).to.equal(false)
```

- **参照:** [よくある落とし穴](/ja/common-gotchas.md)
136 changes: 136 additions & 0 deletions docs/ja/api/mount.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# mount(component,{,options}])

- **引数:**

- `{Component} component`
- `{Object} options`

- **戻り値:** `{Wrapper}`

- **オプション:**

[オプション](/docs/ja/api/options.md)を参照してください。

- **使い方:**

最初のDOMノードまたはVueコンポーネント一致セレクタの[`Wrapper`](/docs/ja/api/wrapper/README.md)を返します。

有効な[セレクタ](/docs/ja/api/selectors.md)を使用してください。

**オプションなし:**

```js
import { mount } from 'vue-test-utils'
import { expect } from 'chai'
import Foo from './Foo.vue'

describe('Foo', () => {
it('renders a div', () => {
const wrapper = mount(Foo)
expect(wrapper.contains('div')).to.equal(true)
})
})
```
**Vueオプションを使用:**

```js
import { mount } from 'vue-test-utils'
import { expect } from 'chai'
import Foo from './Foo.vue'

describe('Foo', () => {
it('renders a div', () => {
const wrapper = mount(Foo, {
propsData: {
color: 'red'
}
})
expect(wrapper.hasProp('color', 'red')).to.equal(true)
})
})
```

**DOMへのアタッチ:**

```js
import { mount } from 'vue-test-utils'
import { expect } from 'chai'
import Foo from './Foo.vue'

describe('Foo', () => {
it('renders a div', () => {
const wrapper = mount(Foo, {
attachToDocument: true
})
expect(wrapper.contains('div')).to.equal(true)
})
})
```
**デフォルトおよび名前付きスロット:**

```js
import { mount } from 'vue-test-utils'
import { expect } from 'chai'
import Foo from './Foo.vue'
import Bar from './Bar.vue'
import FooBar from './FooBar.vue'

describe('Foo', () => {
it('renders a div', () => {
const wrapper = mount(Foo, {
slots: {
default: [Bar, FooBar],
fooBar: FooBar, // <slot name="FooBar" /> と一致する,
foo: '<div />'
}
})
expect(wrapper.contains('div')).to.equal(true)
})
})
```

**グローバルプロパティのスタブ:**

```js
import { mount } from 'vue-test-utils'
import { expect } from 'chai'
import Foo from './Foo.vue'

describe('Foo', () => {
it('renders a div', () => {
const $route = { path: 'http://www.example-path.com' }
const wrapper = mount(Foo, {
intercept: {
$route
}
})
expect(wrapper.vm.$route.path).to.equal($route.path)
})
})
```

**コンポーネントのスタブ:**

```js
import { mount } from 'vue-test-utils'
import { expect } from 'chai'
import Foo from './Foo.vue'
import Bar from './Bar.vue'
import Faz from './Faz.vue'

describe('Foo', () => {
it('renders a div', () => {
const wrapper = mount(Foo, {
stub: {
Bar: '<div class="stubbed />',
BarFoo: true,
FooBar: Faz
}
})
expect(wrapper.contains('.stubbed')).to.equal(true)
expect(wrapper.contains(Bar)).to.equal(true)
})
})
```

- **参照:** [`Wrapper`](/docs/ja/api/wrapper/README.md)
Loading