mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
fix some tests
This commit is contained in:
parent
25d106e2ab
commit
15bc36afb0
@ -6,6 +6,6 @@ module.exports = function () {
|
|||||||
// Add /api endpoint
|
// Add /api endpoint
|
||||||
this.addTemplate({
|
this.addTemplate({
|
||||||
fileName: 'router.js',
|
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 => {
|
test.serial('Nuxt.js Instance', async t => {
|
||||||
const nuxt = new Nuxt({
|
const nuxt = new Nuxt({
|
||||||
dev: false,
|
|
||||||
runBuild: true,
|
|
||||||
rootDir: resolve(__dirname, 'fixtures', 'empty')
|
rootDir: resolve(__dirname, 'fixtures', 'empty')
|
||||||
})
|
})
|
||||||
t.is(typeof nuxt, 'object')
|
t.is(typeof nuxt, 'object')
|
||||||
t.is(nuxt.options.dev, false)
|
t.is(nuxt.options.dev, true)
|
||||||
t.is(typeof nuxt.build, 'function')
|
|
||||||
t.is(typeof nuxt.generate, 'function')
|
t.is(typeof nuxt.generate, 'function')
|
||||||
t.is(typeof nuxt._init.then, 'function')
|
t.is(typeof nuxt._init.then, 'function')
|
||||||
await nuxt.init()
|
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)
|
let s = String(err)
|
||||||
t.true(s.includes('No `pages` directory found'))
|
t.true(s.includes('No `pages` directory found'))
|
||||||
t.true(s.includes('Did you mean to run `nuxt` in the parent (`../`) directory?'))
|
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)
|
let s = String(err)
|
||||||
t.true(s.includes('Couldn\'t find a `pages` directory'))
|
t.true(s.includes('Couldn\'t find a `pages` directory'))
|
||||||
t.true(s.includes('Please create one under the project root'))
|
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
|
config.runBuild = true
|
||||||
nuxt = new Nuxt(config)
|
nuxt = new Nuxt(config)
|
||||||
await nuxt.init()
|
await nuxt.init()
|
||||||
server = new nuxt.Server(nuxt)
|
server = new Nuxt.Server(nuxt)
|
||||||
server.listen(port, 'localhost')
|
server.listen(port, 'localhost')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user