From: Evan You Date: Tue, 3 Sep 2019 22:30:52 +0000 (-0400) Subject: test: test app asset retrieval X-Git-Tag: v3.0.0-alpha.0~834 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=406dcb0a7a1c5e7068d892567d04a15623d15428;p=thirdparty%2Fvuejs%2Fcore.git test: test app asset retrieval --- diff --git a/packages/runtime-core/__tests__/apiApp.spec.ts b/packages/runtime-core/__tests__/apiApp.spec.ts index de66cfefbb..07e23113c6 100644 --- a/packages/runtime-core/__tests__/apiApp.spec.ts +++ b/packages/runtime-core/__tests__/apiApp.spec.ts @@ -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 })