Skip to content

Commit

Permalink
Explicitly assert on errors instead of the error number (vercel#69512)
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon authored Sep 3, 2024
1 parent 9afc84d commit e366f3b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/integration/link-ref/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ const noError = async (pathname) => {
await browser.eval(`(function() {
window.caughtErrors = []
const origError = window.console.error
window.console.error = function () {
window.caughtErrors.push(1)
window.console.error = function (format) {
window.caughtErrors.push(format)
origError(arguments)
}
window.next.router.replace('${pathname}')
})()`)
await waitFor(1000)
const numErrors = await browser.eval(`window.caughtErrors.length`)
expect(numErrors).toBe(0)
const errors = await browser.eval(`window.caughtErrors`)
expect(errors).toEqual([])
await browser.close()
}

Expand Down

0 comments on commit e366f3b

Please sign in to comment.