fix: Fix node 6 tests

This commit is contained in:
Atinux 2017-11-07 16:55:54 +01:00
parent 244644f192
commit e811470576

View File

@ -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