mirror of https://github.com/vuejs/core.git
chore: fix test
This commit is contained in:
parent
b4b82159e2
commit
7cf143dd4f
|
@ -673,7 +673,8 @@ function finishComponentSetup(
|
||||||
// 1. the render function may already exist, returned by `setup`
|
// 1. the render function may already exist, returned by `setup`
|
||||||
// 2. otherwise try to use the `Component.render`
|
// 2. otherwise try to use the `Component.render`
|
||||||
// 3. if the component doesn't have a render function,
|
// 3. if the component doesn't have a render function,
|
||||||
// set `instance.render` to NOOP so that it can inherit the render function from mixins/extend
|
// set `instance.render` to NOOP so that it can inherit the render
|
||||||
|
// function from mixins/extend
|
||||||
instance.render = (instance.render ||
|
instance.render = (instance.render ||
|
||||||
Component.render ||
|
Component.render ||
|
||||||
NOOP) as InternalRenderFunction
|
NOOP) as InternalRenderFunction
|
||||||
|
|
|
@ -781,8 +781,10 @@ function testRender(type: string, render: typeof renderToString) {
|
||||||
test('effect onInvalidate does not error', async () => {
|
test('effect onInvalidate does not error', async () => {
|
||||||
const noop = () => {}
|
const noop = () => {}
|
||||||
const app = createApp({
|
const app = createApp({
|
||||||
setup: () => watchEffect(onInvalidate => onInvalidate(noop)),
|
setup: () => {
|
||||||
render: noop,
|
watchEffect(onInvalidate => onInvalidate(noop))
|
||||||
|
},
|
||||||
|
render: noop
|
||||||
})
|
})
|
||||||
expect(await render(app)).toBe('<!---->')
|
expect(await render(app)).toBe('<!---->')
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue