mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-13 17:43:59 +00:00
21 lines
458 B
JavaScript
21 lines
458 B
JavaScript
import test from 'ava'
|
|
import { resolve } from 'path'
|
|
|
|
test('Fail with routes() which throw an error', async t => {
|
|
const Nuxt = require('../')
|
|
const options = {
|
|
rootDir: resolve(__dirname, 'fixtures/basic'),
|
|
dev: false,
|
|
generate: {
|
|
async routes () {
|
|
throw new Error('Not today!')
|
|
}
|
|
}
|
|
}
|
|
const nuxt = new Nuxt(options)
|
|
return nuxt.generate()
|
|
.catch((e) => {
|
|
t.true(e.message === 'Not today!')
|
|
})
|
|
})
|