mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
9b8cbed512
Using native node 8.x for less transpilations
23 lines
563 B
JavaScript
23 lines
563 B
JavaScript
import test from 'ava'
|
|
import { resolve } from 'path'
|
|
import { Nuxt, Builder, Generator } from '..'
|
|
|
|
test('Fail with routes() which throw an error', async t => {
|
|
const options = {
|
|
rootDir: resolve(__dirname, 'fixtures/basic'),
|
|
dev: false,
|
|
generate: {
|
|
async routes() {
|
|
throw new Error('Not today!')
|
|
}
|
|
}
|
|
}
|
|
const nuxt = new Nuxt(options)
|
|
const builder = new Builder(nuxt)
|
|
const generator = new Generator(nuxt, builder)
|
|
return generator.generate()
|
|
.catch((e) => {
|
|
t.true(e.message === 'Not today!')
|
|
})
|
|
})
|