Nuxt/test/basic.fail.generate.test.js
2017-06-16 17:19:35 +04:30

22 lines
483 B
JavaScript

import test from 'ava'
import { resolve } from 'path'
import { Nuxt } from '../index.js'
test('Fail with routes() which throw an error', async t => {
const options = {
rootDir: resolve(__dirname, 'fixtures/basic'),
dev: false,
runBuild: true,
generate: {
async routes () {
throw new Error('Not today!')
}
}
}
const nuxt = new Nuxt(options)
return nuxt.generate()
.catch((e) => {
t.true(e.message === 'Not today!')
})
})