Skip to content

Commit

Permalink
chore(tests): Make tests compatible with Nuxt 2.11
Browse files Browse the repository at this point in the history
Required due to router.push shim introduced in
nuxt/nuxt#6722
  • Loading branch information
rchl committed Jan 20, 2020
1 parent 048f706 commit 2a260fa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/browser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ const createNavigator = page => {
// When returning value resolved by `push`, `chrome/selenium`` crashes with:
// WebDriverError: unknown error: unhandled inspector error: {"code":-32000,"message":"Object reference chain is too long"}
// Chain and return nothing to work around.
await page.runAsyncScript(path => window.$nuxt.$router.push(path).then(() => {}), path)
await page.runAsyncScript(path => {
return new Promise((resolve, reject) => {
window.$nuxt.$router.push(path, resolve, reject)
})
}, path)
await new Promise(resolve => setTimeout(resolve, 50))
}
}
Expand Down

0 comments on commit 2a260fa

Please sign in to comment.