|
|
@@ -8,9 +8,10 @@ import {
|
|
|
defineComponent,
|
|
|
createTextVNode,
|
|
|
createStaticVNode,
|
|
|
- KeepAlive,
|
|
|
withCtx,
|
|
|
- Transition
|
|
|
+ KeepAlive,
|
|
|
+ Transition,
|
|
|
+ watchEffect
|
|
|
} from 'vue'
|
|
|
import { escapeHtml } from '@vue/shared'
|
|
|
import { renderToString } from '../src/renderToString'
|
|
|
@@ -775,5 +776,15 @@ function testRender(type: string, render: typeof renderToString) {
|
|
|
const html = await render(app)
|
|
|
expect(html).toBe(`<div>hello</div>`)
|
|
|
})
|
|
|
+
|
|
|
+ // https://github.com/vuejs/vue-next/issues/3322
|
|
|
+ test('effect onInvalidate does not error', async () => {
|
|
|
+ const noop = () => {}
|
|
|
+ const app = createApp({
|
|
|
+ setup: () => watchEffect(onInvalidate => onInvalidate(noop)),
|
|
|
+ render: noop,
|
|
|
+ })
|
|
|
+ expect(await render(app)).toBe('<!---->')
|
|
|
+ })
|
|
|
})
|
|
|
}
|