diff --git a/examples/with-ava/test/index.test.js b/examples/with-ava/test/index.test.js index 971bccde38..ac6b367d91 100755 --- a/examples/with-ava/test/index.test.js +++ b/examples/with-ava/test/index.test.js @@ -1,17 +1,20 @@ import { resolve } from 'path' - -import test from 'ava' import { Nuxt, Builder } from 'nuxt' +import { JSDOM } from 'jsdom' +import test from 'ava' // We keep the nuxt and server instance // So we can close them at the end of the test let nuxt = null // Init Nuxt.js and create a server listening on localhost:4000 -beforeAll(async () => { +test.before(async () => { const rootDir = resolve(__dirname, '..') let config = {} - try { config = require(resolve(rootDir, 'nuxt.config.js')) } catch (e) {} + try { + config = require(resolve(rootDir, 'nuxt.config.js')) + } catch (e) { + } config.rootDir = rootDir // project folder config.dev = false // production build nuxt = new Nuxt(config) @@ -21,14 +24,16 @@ beforeAll(async () => { // Example of testing only generated html test('Route / exits and render HTML', async t => { - let context = {} + const context = {} const { html } = await nuxt.renderRoute('/', context) t.true(html.includes('