From 7a7239d35deffe170c6bdfe880a843ae75bcfb1e Mon Sep 17 00:00:00 2001 From: Clark Du Date: Sun, 8 Apr 2018 20:16:20 +0800 Subject: [PATCH] refactor: ava test --- examples/with-ava/test/index.test.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/examples/with-ava/test/index.test.js b/examples/with-ava/test/index.test.js index ac6b367d91..d6e0a308d8 100755 --- a/examples/with-ava/test/index.test.js +++ b/examples/with-ava/test/index.test.js @@ -9,16 +9,12 @@ let nuxt = null // Init Nuxt.js and create a server listening on localhost:4000 test.before(async () => { - const rootDir = resolve(__dirname, '..') - let config = {} - try { - config = require(resolve(rootDir, 'nuxt.config.js')) - } catch (e) { + const config = { + dev: false, + rootDir: resolve(__dirname, '..') } - config.rootDir = rootDir // project folder - config.dev = false // production build nuxt = new Nuxt(config) - new Builder(nuxt).build() + await new Builder(nuxt).build() await nuxt.listen(4000, 'localhost') }, 30000)