소스 검색

test: improve inject default test case

Evan You 8 년 전
부모
커밋
3c65239ad4
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      test/unit/features/options/inject.spec.js

+ 4 - 1
test/unit/features/options/inject.spec.js

@@ -380,11 +380,14 @@ describe('Options provide/inject', () => {
         bar: { default: false },
         baz: { default: undefined }
       },
-      created () {}
+      created () {
+        injected = [this.foo, this.bar, this.baz]
+      }
     })
     expect(`Injection "foo" not found`).not.toHaveBeenWarned()
     expect(`Injection "bar" not found`).not.toHaveBeenWarned()
     expect(`Injection "baz" not found`).not.toHaveBeenWarned()
+    expect(injected).toEqual([1, false, undefined])
   })
 
   it('should use provided value even if inject has default', () => {