From 15bc36afb0ac0cfe465bf69111da223b1a9972e8 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Thu, 15 Jun 2017 14:33:54 +0430 Subject: [PATCH] fix some tests --- test/fixtures/module/modules/template/index.js | 2 +- test/index.test.js | 7 +------ test/module.test.js | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/test/fixtures/module/modules/template/index.js b/test/fixtures/module/modules/template/index.js index 4ae607b4b6..4a2d917897 100644 --- a/test/fixtures/module/modules/template/index.js +++ b/test/fixtures/module/modules/template/index.js @@ -6,6 +6,6 @@ module.exports = function () { // Add /api endpoint this.addTemplate({ fileName: 'router.js', - src: path.resolve(this.nuxt.srcDir, 'router.js') + src: path.resolve(this.options.srcDir, 'router.js') }) } diff --git a/test/index.test.js b/test/index.test.js index b54b304715..21e09014f3 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -9,13 +9,10 @@ test('Nuxt.js Class', t => { test.serial('Nuxt.js Instance', async t => { const nuxt = new Nuxt({ - dev: false, - runBuild: true, rootDir: resolve(__dirname, 'fixtures', 'empty') }) t.is(typeof nuxt, 'object') - t.is(nuxt.options.dev, false) - t.is(typeof nuxt.build, 'function') + t.is(nuxt.options.dev, true) t.is(typeof nuxt.generate, 'function') t.is(typeof nuxt._init.then, 'function') await nuxt.init() @@ -32,7 +29,6 @@ test.serial('Fail to build when no pages/ directory but is in the parent', t => let s = String(err) t.true(s.includes('No `pages` directory found')) t.true(s.includes('Did you mean to run `nuxt` in the parent (`../`) directory?')) - resolve() }) }) @@ -46,6 +42,5 @@ test.serial('Fail to build when no pages/ directory', t => { let s = String(err) t.true(s.includes('Couldn\'t find a `pages` directory')) t.true(s.includes('Please create one under the project root')) - resolve() }) }) diff --git a/test/module.test.js b/test/module.test.js index 646408e92d..bdb658a82e 100755 --- a/test/module.test.js +++ b/test/module.test.js @@ -18,7 +18,7 @@ test.before('Init Nuxt.js', async t => { config.runBuild = true nuxt = new Nuxt(config) await nuxt.init() - server = new nuxt.Server(nuxt) + server = new Nuxt.Server(nuxt) server.listen(port, 'localhost') })