소스 검색

#192 Fix testing example in the documentation (#195)

lazystone 9 년 전
부모
커밋
4028b188b7
5개의 변경된 파일10개의 추가작업 그리고 10개의 파일을 삭제
  1. 2 2
      docs/en/testing.md
  2. 2 2
      docs/es/testing.md
  3. 2 2
      docs/it/testing.md
  4. 2 2
      docs/pt/testing.md
  5. 2 2
      docs/zh-cn/testing.md

+ 2 - 2
docs/en/testing.md

@@ -102,8 +102,8 @@ const testAction = (action, args, state, expectedMutations, done) => {
   action({dispatch, state}, ...args)
   action({dispatch, state}, ...args)
 
 
   // check if no mutations should have been dispatched
   // check if no mutations should have been dispatched
-  if (count === 0) {
-    expect(expectedMutations.length).to.equal(0)
+  if (expectedMutations.length === 0) {
+    expect(count).to.equal(0)
     done()
     done()
   }
   }
 }
 }

+ 2 - 2
docs/es/testing.md

@@ -102,8 +102,8 @@ const testAction = (action, args, state, expectedMutations, done) => {
   action({dispatch, state}, ...args)
   action({dispatch, state}, ...args)
 
 
   // comprobar si no deberían haber sido despachadas mutaciones
   // comprobar si no deberían haber sido despachadas mutaciones
-  if (count === 0) {
-    expect(expectedMutations.length).to.equal(0)
+  if (expectedMutations.length === 0) {
+    expect(count).to.equal(0)
     done()
     done()
   }
   }
 }
 }

+ 2 - 2
docs/it/testing.md

@@ -100,8 +100,8 @@ const testAction = (action, args, state, expectedMutations, done) => {
   }
   }
   action({dispatch, state}, ...args)
   action({dispatch, state}, ...args)
 
 
-  if (count === 0) {
-    expect(expectedMutations.length).to.equal(0)
+  if (expectedMutations.length === 0) {
+    expect(count).to.equal(0)
     done()
     done()
   }
   }
 }
 }

+ 2 - 2
docs/pt/testing.md

@@ -102,8 +102,8 @@ const testAction = (action, args, state, expectedMutations, done) => {
   action({dispatch, state}, ...args)
   action({dispatch, state}, ...args)
 
 
   // check if no mutations should have been dispatched
   // check if no mutations should have been dispatched
-  if (count === 0) {
-    expect(expectedMutations.length).to.equal(0)
+  if (expectedMutations.length === 0) {
+    expect(count).to.equal(0)
     done()
     done()
   }
   }
 }
 }

+ 2 - 2
docs/zh-cn/testing.md

@@ -96,8 +96,8 @@ const testAction = (action, args, state, expectedMutations, done) => {
   action({dispatch, state}, ...args)
   action({dispatch, state}, ...args)
 
 
   // 检查是否没有 mutation 被 dispatch
   // 检查是否没有 mutation 被 dispatch
-  if (count === 0) {
-    expect(expectedMutations.length).to.equal(0)
+  if (expectedMutations.length === 0) {
+    expect(count).to.equal(0)
     done()
     done()
   }
   }
 }
 }