mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 15:22:39 +00:00
fix: Fix node 6 tests
This commit is contained in:
parent
244644f192
commit
e811470576
@ -28,9 +28,9 @@ export async function page(url) {
|
||||
|
||||
page.nuxt = {
|
||||
async navigate(path, waitEnd = true) {
|
||||
const hook = page.evaluate(async () => {
|
||||
await new Promise((resolve) => window.$nuxt.$once('routeChanged', resolve))
|
||||
await new Promise((resolve) => setTimeout(resolve, 50))
|
||||
const hook = page.evaluate(() => {
|
||||
return new Promise((resolve) => window.$nuxt.$once('routeChanged', resolve))
|
||||
.then(() => new Promise((resolve) => setTimeout(resolve, 50)))
|
||||
})
|
||||
await page.evaluate(($nuxt, path) => $nuxt.$router.push(path), page.$nuxt, path)
|
||||
if (waitEnd) await hook
|
||||
|
Loading…
Reference in New Issue
Block a user