fix(runtime-core): fix error when passed plugin is undefined (#502)
This commit is contained in:
committed by
Evan You
parent
cfa7efe4e8
commit
fbcc47841b
@@ -244,6 +244,7 @@ describe('api: createApp', () => {
|
||||
const PluginB: Plugin = {
|
||||
install: app => app.provide('bar', 2)
|
||||
}
|
||||
const PluginC: any = undefined
|
||||
|
||||
const app = createApp()
|
||||
app.use(PluginA)
|
||||
@@ -264,6 +265,12 @@ describe('api: createApp', () => {
|
||||
expect(
|
||||
`Plugin has already been applied to target app`
|
||||
).toHaveBeenWarnedTimes(1)
|
||||
|
||||
app.use(PluginC)
|
||||
expect(
|
||||
`A plugin must either be a function or an object with an "install" ` +
|
||||
`function.`
|
||||
).toHaveBeenWarnedTimes(1)
|
||||
})
|
||||
|
||||
test('config.errorHandler', () => {
|
||||
|
||||
Reference in New Issue
Block a user