Nuxt/test/unit/basic.fail.generate.test.js
Clark Du ef7a42649d misc: improve coverage and packaging (#3121)
nuxt-start and nuxt/legacy are also coming!
2018-03-28 02:58:17 +04:30

21 lines
509 B
JavaScript

import { loadFixture, Nuxt, Generator } from '../utils'
describe('basic fail generate', () => {
test('Fail with routes() which throw an error', async () => {
const options = loadFixture('basic', {
generate: {
async routes() {
throw new Error('Not today!')
}
}
})
const nuxt = new Nuxt(options)
const generator = new Generator(nuxt)
await generator.generate({ build: false }).catch(e => {
expect(e.message).toBe('Not today!')
})
})
})