Nuxt/test/basic.fail.generate.test.js
Pooya Parsa 9b8cbed512 perf: remove rollup build
Using native node 8.x for less transpilations
2017-12-12 13:12:29 +03:30

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!')
})
})