Skip to content

Commit 0cddde6

Browse files
authored
test(runtime-core): test app API warnings (#2079)
1 parent c65d6de commit 0cddde6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/runtime-core/__tests__/apiCreateApp.spec.ts

+10
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ describe('api: createApp', () => {
5858

5959
const root = nodeOps.createElement('div')
6060
const app = createApp(Comp)
61+
62+
// warning
63+
app.unmount(root)
64+
expect(`that is not mounted`).toHaveBeenWarned()
65+
6166
app.mount(root)
6267

6368
app.unmount(root)
@@ -92,6 +97,11 @@ describe('api: createApp', () => {
9297
app.mount(root)
9398
expect(serializeInner(root)).toBe(`3,2`)
9499
expect('[Vue warn]: injection "__proto__" not found.').toHaveBeenWarned()
100+
101+
const app2 = createApp(Root)
102+
app2.provide('bar', 1)
103+
app2.provide('bar', 2)
104+
expect(`App already provides property with key "bar".`).toHaveBeenWarned()
95105
})
96106

97107
test('component', () => {

0 commit comments

Comments
 (0)