mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 16:12:12 +00:00
fix some tests
This commit is contained in:
parent
25d106e2ab
commit
15bc36afb0
@ -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')
|
||||
})
|
||||
}
|
||||
|
@ -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()
|
||||
})
|
||||
})
|
||||
|
@ -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')
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user