Explorar o código

test: improve inject default test case

Evan You %!s(int64=8) %!d(string=hai) anos
pai
achega
3c65239ad4
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  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', () => {