Skip to content

Commit

Permalink
test(vue): update template empty test
Browse files Browse the repository at this point in the history
refs #2142
  • Loading branch information
sapphi-red committed Nov 14, 2022
1 parent 0c700c5 commit 9d91833
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/plugin-vue/src/handleHotUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function hasScriptChanged(prev: SFCDescriptor, next: SFCDescriptor): boolean {
// this is only available in vue@^3.2.23
const prevImports = prevResolvedScript?.imports
if (prevImports) {
return next.shouldForceReload(prevImports)
return !next.template || next.shouldForceReload(prevImports)
}

return false
Expand Down
2 changes: 1 addition & 1 deletion playground/vue/__tests__/vue.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ describe('hmr', () => {
})

test('should re-render when template is emptied', async () => {
editFile('Hmr.vue', () => '')
editFile('Hmr.vue', (code) => code.replace(/<template>.+<\/template>/s, ''))
await untilUpdated(() => page.innerHTML('.hmr-block'), '<!---->')
})
})
Expand Down

0 comments on commit 9d91833

Please sign in to comment.