test(runtime-core): test app API warnings (#2079)

This commit is contained in:
edison 2020-09-15 09:48:38 +08:00 committed by GitHub
parent c65d6def84
commit 0cddde6aa4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,6 +58,11 @@ describe('api: createApp', () => {
const root = nodeOps.createElement('div') const root = nodeOps.createElement('div')
const app = createApp(Comp) const app = createApp(Comp)
// warning
app.unmount(root)
expect(`that is not mounted`).toHaveBeenWarned()
app.mount(root) app.mount(root)
app.unmount(root) app.unmount(root)
@ -92,6 +97,11 @@ describe('api: createApp', () => {
app.mount(root) app.mount(root)
expect(serializeInner(root)).toBe(`3,2`) expect(serializeInner(root)).toBe(`3,2`)
expect('[Vue warn]: injection "__proto__" not found.').toHaveBeenWarned() 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', () => { test('component', () => {