]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
test: test app asset retrieval
authorEvan You <yyx990803@gmail.com>
Tue, 3 Sep 2019 22:30:52 +0000 (18:30 -0400)
committerEvan You <yyx990803@gmail.com>
Tue, 3 Sep 2019 22:30:52 +0000 (18:30 -0400)
packages/runtime-core/__tests__/apiApp.spec.ts

index de66cfefbb5570b89a82445d2e301da3b73e8630..07e23113c66e12399f79b41337e4a1f3b52a10ef 100644 (file)
@@ -73,7 +73,11 @@ describe('api: createApp', () => {
 
   test('component', () => {
     const app = createApp()
-    app.component('FooBar', () => 'foobar!')
+
+    const FooBar = () => 'foobar!'
+    app.component('FooBar', FooBar)
+    expect(app.component('FooBar')).toBe(FooBar)
+
     app.component('BarBaz', () => 'barbaz!')
 
     const Root = {
@@ -103,9 +107,11 @@ describe('api: createApp', () => {
     const spy1 = jest.fn()
     const spy2 = jest.fn()
     const spy3 = jest.fn()
-    app.directive('FooBar', {
-      mounted: spy1
-    })
+
+    const FooBar = { mounted: spy1 }
+    app.directive('FooBar', FooBar)
+    expect(app.directive('FooBar')).toBe(FooBar)
+
     app.directive('BarBaz', {
       mounted: spy2
     })