From e8114705766385dd5ba650c6280b0b616bbfd3ac Mon Sep 17 00:00:00 2001 From: Atinux Date: Tue, 7 Nov 2017 16:55:54 +0100 Subject: [PATCH] fix: Fix node 6 tests --- test/helpers/browser.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/helpers/browser.js b/test/helpers/browser.js index 4ba30bfa2d..4da905d426 100644 --- a/test/helpers/browser.js +++ b/test/helpers/browser.js @@ -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