Skip to content

Commit eb4c033

Browse files
committed
fixup! test: use page.waitForFunction for HMR testing
1 parent 2622f8d commit eb4c033

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/@vue/cli-plugin-typescript/__tests__/tsPlugin.helper.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ exports.assertServe = async (name, options) => {
2020
project.write(`src/App.vue`, file.replace(msg, `Updated`))
2121
await nextUpdate() // wait for child stdout update signal
2222
await page.waitForFunction(selector => {
23-
return document.querySelector(selector).textContent.includes('Updated')
23+
const el = document.querySelector(selector)
24+
return el && el.textContent.includes('Updated')
2425
}, {}, 'h1')
2526
}
2627
)

0 commit comments

Comments
 (0)