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 = { page.nuxt = {
async navigate(path, waitEnd = true) { async navigate(path, waitEnd = true) {
const hook = page.evaluate(async () => { const hook = page.evaluate(() => {
await new Promise((resolve) => window.$nuxt.$once('routeChanged', resolve)) return new Promise((resolve) => window.$nuxt.$once('routeChanged', resolve))
await new Promise((resolve) => setTimeout(resolve, 50)) .then(() => new Promise((resolve) => setTimeout(resolve, 50)))
}) })
await page.evaluate(($nuxt, path) => $nuxt.$router.push(path), page.$nuxt, path) await page.evaluate(($nuxt, path) => $nuxt.$router.push(path), page.$nuxt, path)
if (waitEnd) await hook if (waitEnd) await hook