From d2ee6ff3d5c7ff76580044260ea10887450b03e9 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Mon, 16 Jul 2018 18:05:13 -0400 Subject: [PATCH] argh --- test/common/test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/common/test.js b/test/common/test.js index 182fcaa..41efb1d 100644 --- a/test/common/test.js +++ b/test/common/test.js @@ -32,6 +32,8 @@ Nightmare.action('prefetchRoutes', function(done) { const cli = path.resolve(__dirname, '../../sapper'); +const wait = ms => new Promise(f => setTimeout(f, ms)); + describe('sapper', function() { process.chdir(path.resolve(__dirname, '../app')); @@ -266,8 +268,9 @@ function run({ mode, basepath = '' }) { }) .then(requests => { assert.deepEqual(requests.map(r => r.url), []); - return nightmare.path(); }) + .then(() => wait(100)) + .then(() => nightmare.path()) .then(path => { assert.equal(path, `${basepath}/about`); return nightmare.title();