Skip to content

Commit 717d766

Browse files
committed
docs: update all locale testing.md to the latest
1 parent d2584b1 commit 717d766

File tree

5 files changed

+13
-23
lines changed

5 files changed

+13
-23
lines changed

docs/fr/guide/testing.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ const testAction = (action, args, state, expectedMutations, done) => {
9797

9898
try {
9999
expect(mutation.type).to.equal(type)
100-
if (payload) {
101-
expect(payload).to.deep.equal(mutation.payload)
102-
}
100+
expect(payload).to.deep.equal(mutation.payload)
103101
} catch (error) {
104102
done(error)
105103
}

docs/ja/guide/testing.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe('mutations', () => {
5050
```
5151

5252
### アクションのテスト
53-
53+
5454
アクションは外部の API を呼び出す可能性があるため、ミューテーションのテストよりも少し注意が必要です。アクションをテストするとき、通常、いくつかの段階でモックを作る必要があります。例えば API 呼び出しをサービスとして抽象化し、そしてテストの内部ではそのサービスをモックにすることができます。簡単に依存関係をモック化するために、webpack と [inject-loader](https://github.com/plasticine/inject-loader) を使ってテストファイルをバンドルすることができます。
5555

5656
非同期なアクションのテストの例:
@@ -96,9 +96,7 @@ const testAction = (action, payload, state, expectedMutations, done) => {
9696

9797
try {
9898
expect(type).to.equal(mutation.type)
99-
if (payload) {
100-
expect(payload).to.deep.equal(mutation.payload)
101-
}
99+
expect(payload).to.deep.equal(mutation.payload)
102100
} catch (error) {
103101
done(error)
104102
}
@@ -233,7 +231,7 @@ mocha test-bundle.js
233231
1. `mocha-loader` をインストールする
234232
2. 上記 webpack 設定から `entry``'mocha-loader!babel-loader!./test.js'` に変更する
235233
3. 設定を使用して `webpack-dev-server` を開始する
236-
4. ブラウザで `localhost:8080/webpack-dev-server/test-bundle` を開く
234+
4. ブラウザで `localhost:8080/webpack-dev-server/test-bundle` を開く
237235

238236
#### Karma + karma-webpack を使ったブラウザでの実行
239237

docs/kr/guide/testing.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ const testAction = (action, payload, state, expectedMutations, done) => {
9797

9898
try {
9999
expect(type).to.equal(mutation.type)
100-
if (payload) {
101-
expect(payload).to.deep.equal(mutation.payload)
102-
}
100+
expect(payload).to.deep.equal(mutation.payload)
103101
} catch (error) {
104102
done(error)
105103
}
@@ -137,9 +135,9 @@ describe('actions', () => {
137135
it('getAllProducts', () => {
138136
const commit = sinon.spy()
139137
const state = {}
140-
138+
141139
actions.getAllProducts({ commit, state })
142-
140+
143141
expect(commit.args).to.deep.equal([
144142
['REQUEST_PRODUCTS'],
145143
['RECEIVE_PRODUCTS', { /* 모의 응답 */ }]

docs/ptbr/guide/testing.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ const testAction = (action, payload, state, expectedMutations, done) => {
9797

9898
try {
9999
expect(type).to.equal(mutation.type)
100-
if (payload) {
101-
expect(payload).to.deep.equal(mutation.payload)
102-
}
100+
expect(payload).to.deep.equal(mutation.payload)
103101
} catch (error) {
104102
done(error)
105103
}
@@ -137,9 +135,9 @@ describe('actions', () => {
137135
it('getAllProducts', () => {
138136
const commit = sinon.spy()
139137
const state = {}
140-
138+
141139
actions.getAllProducts({ commit, state })
142-
140+
143141
expect(commit.args).to.deep.equal([
144142
['REQUEST_PRODUCTS'],
145143
['RECEIVE_PRODUCTS', { /* resposta simulada */ }]

docs/zh/guide/testing.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ const testAction = (action, args, state, expectedMutations, done) => {
9696

9797
try {
9898
expect(mutation.type).to.equal(type)
99-
if (payload) {
100-
expect(mutation.payload).to.deep.equal(payload)
101-
}
99+
expect(mutation.payload).to.deep.equal(payload)
102100
} catch (error) {
103101
done(error)
104102
}
@@ -136,9 +134,9 @@ describe('actions', () => {
136134
it('getAllProducts', () => {
137135
const commit = sinon.spy()
138136
const state = {}
139-
137+
140138
actions.getAllProducts({ commit, state })
141-
139+
142140
expect(commit.args).to.deep.equal([
143141
['REQUEST_PRODUCTS'],
144142
['RECEIVE_PRODUCTS', { /* mocked response */ }]

0 commit comments

Comments
 (0)