From 33db91eed5af72c27d3ba929860a26198e6cf787 Mon Sep 17 00:00:00 2001 From: pooya parsa Date: Sun, 24 Mar 2019 16:29:15 +0430 Subject: [PATCH] update tests --- babel.config.js | 11 ----------- test/_utils.js | 8 +++++--- test/baseURL.test.js | 2 +- test/empty-config.test.js | 2 +- test/module.test.js | 4 +++- 5 files changed, 10 insertions(+), 17 deletions(-) delete mode 100644 babel.config.js diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index 0dffd91..0000000 --- a/babel.config.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - presets: [ - [ - '@babel/preset-env', { - targets: { - esmodules: true - } - } - ] - ] -} diff --git a/test/_utils.js b/test/_utils.js index d0a414d..cf49b57 100644 --- a/test/_utils.js +++ b/test/_utils.js @@ -13,10 +13,12 @@ async function setupNuxt(config) { // Spy addTemplate nuxt.moduleContainer.addTemplate = jest.fn(nuxt.moduleContainer.addTemplate) - const build = new Builder(nuxt) + const builder = new Builder(nuxt) - await build.validatePages() - await build.generateRoutesAndFiles() + await builder.validatePages() + await builder.generateRoutesAndFiles() + + nuxt.builder = builder await nuxt.listen(3000) diff --git a/test/baseURL.test.js b/test/baseURL.test.js index 6ba8e7c..87b6533 100644 --- a/test/baseURL.test.js +++ b/test/baseURL.test.js @@ -3,7 +3,7 @@ const { setupNuxt } = require('./_utils') describe('browserBaseURL', () => { let nuxt - beforeAll(async () => { + test('setup', async () => { nuxt = await setupNuxt({ http: { browserBaseURL: '/test_api' diff --git a/test/empty-config.test.js b/test/empty-config.test.js index a202ec2..632ba5a 100644 --- a/test/empty-config.test.js +++ b/test/empty-config.test.js @@ -3,7 +3,7 @@ const { setupNuxt } = require('./_utils') describe('empty config', () => { let nuxt - beforeAll(async () => { + test('setup', async () => { nuxt = await setupNuxt({ http: {} }) diff --git a/test/module.test.js b/test/module.test.js index 3d4752c..bcf007e 100644 --- a/test/module.test.js +++ b/test/module.test.js @@ -6,8 +6,10 @@ const url = path => `http://localhost:3000${path}` describe('module', () => { let nuxt - beforeAll(async () => { + test('setup', async () => { nuxt = await setupNuxt() + + await nuxt.builder.build() }) afterAll(async () => {