mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-24 06:35:10 +00:00
22 lines
533 B
JavaScript
22 lines
533 B
JavaScript
import { Nuxt, Generator } from '../../'
|
|
import { loadFixture } 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!')
|
|
})
|
|
})
|
|
})
|