Skip to content

Commit

Permalink
fixup! test: use page.waitForFunction for HMR testing
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Sep 4, 2019
1 parent 2622f8d commit eb4c033
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ exports.assertServe = async (name, options) => {
project.write(`src/App.vue`, file.replace(msg, `Updated`))
await nextUpdate() // wait for child stdout update signal
await page.waitForFunction(selector => {
return document.querySelector(selector).textContent.includes('Updated')
const el = document.querySelector(selector)
return el && el.textContent.includes('Updated')
}, {}, 'h1')
}
)
Expand Down

0 comments on commit eb4c033

Please sign in to comment.