Skip to content

Commit

Permalink
chore: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Mar 25, 2021
1 parent b4b8215 commit 7cf143d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/runtime-core/src/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,8 @@ function finishComponentSetup(
// 1. the render function may already exist, returned by `setup`
// 2. otherwise try to use the `Component.render`
// 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 ||
Component.render ||
NOOP) as InternalRenderFunction
Expand Down
6 changes: 4 additions & 2 deletions packages/server-renderer/__tests__/render.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -781,8 +781,10 @@ function testRender(type: string, render: typeof renderToString) {
test('effect onInvalidate does not error', async () => {
const noop = () => {}
const app = createApp({
setup: () => watchEffect(onInvalidate => onInvalidate(noop)),
render: noop,
setup: () => {
watchEffect(onInvalidate => onInvalidate(noop))
},
render: noop
})
expect(await render(app)).toBe('<!---->')
})
Expand Down

0 comments on commit 7cf143d

Please sign in to comment.