test: fix resolveDyanmicComponent test

This commit is contained in:
Evan You 2019-11-25 12:51:57 -05:00
parent 08a3d95e52
commit 16ea2993d6

View File

@ -6,7 +6,8 @@ import {
resolveDirective,
Component,
Directive,
resolveDynamicComponent
resolveDynamicComponent,
getCurrentInstance
} from '@vue/runtime-test'
describe('resolveAssets', () => {
@ -103,10 +104,11 @@ describe('resolveAssets', () => {
const Root = {
components: { foo: dynamicComponents.foo },
setup() {
const instance = getCurrentInstance()!
return () => {
foo = resolveDynamicComponent('foo') // <component is="foo"/>
bar = resolveDynamicComponent(dynamicComponents.bar) // <component :is="bar"/>, function
baz = resolveDynamicComponent(dynamicComponents.baz) // <component :is="baz"/>, object
foo = resolveDynamicComponent('foo', instance) // <component is="foo"/>
bar = resolveDynamicComponent(dynamicComponents.bar, instance) // <component :is="bar"/>, function
baz = resolveDynamicComponent(dynamicComponents.baz, instance) // <component :is="baz"/>, object
}
}
}