Nuxt/test/unit/basic.fail.generate.test.js
Alexander Lichter b4d81dc584 lint: require await in async function (#3676)
* lint: require await in async function

* lint: replace "error" with 2 in config
2018-08-10 08:41:23 +01:00

21 lines
505 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: {
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!')
})
})
})