From: edison Date: Tue, 15 Sep 2020 01:48:38 +0000 (+0800) Subject: test(runtime-core): test app API warnings (#2079) X-Git-Tag: v3.0.0-rc.11~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cddde6aa432ada86a81e980ff06365b27d1b176;p=thirdparty%2Fvuejs%2Fcore.git test(runtime-core): test app API warnings (#2079) --- diff --git a/packages/runtime-core/__tests__/apiCreateApp.spec.ts b/packages/runtime-core/__tests__/apiCreateApp.spec.ts index c3be3476c2..47e0eb6fa4 100644 --- a/packages/runtime-core/__tests__/apiCreateApp.spec.ts +++ b/packages/runtime-core/__tests__/apiCreateApp.spec.ts @@ -58,6 +58,11 @@ describe('api: createApp', () => { const root = nodeOps.createElement('div') const app = createApp(Comp) + + // warning + app.unmount(root) + expect(`that is not mounted`).toHaveBeenWarned() + app.mount(root) app.unmount(root) @@ -92,6 +97,11 @@ describe('api: createApp', () => { app.mount(root) expect(serializeInner(root)).toBe(`3,2`) expect('[Vue warn]: injection "__proto__" not found.').toHaveBeenWarned() + + const app2 = createApp(Root) + app2.provide('bar', 1) + app2.provide('bar', 2) + expect(`App already provides property with key "bar".`).toHaveBeenWarned() }) test('component', () => {