Update tests

This commit is contained in:
Sebastien Chopin 2017-05-11 13:37:21 +02:00
parent 64abcc04a8
commit ac836c77de
3 changed files with 7 additions and 2 deletions

View File

@ -104,13 +104,16 @@ export default function () {
errors.push({ type: 'handled', route, error })
}
} catch (err) {
/* istanbul ignore next */
errors.push({ type: 'unhandled', route, error: err })
return
}
try {
var minifiedHtml = minify(html, self.options.generate.minify)
} catch (err) {
/* istanbul ignore next */
let minifyErr = new Error(`HTML minification failed. Make sure the route generates valid HTML. Failed HTML:\n ${html}`)
/* istanbul ignore next */
errors.push({ type: 'unhandled', route, error: minifyErr })
return
}
@ -137,6 +140,7 @@ export default function () {
if (errors.length) {
const report = errors.map(({ type, route, error }) => {
/* istanbul ignore next */
if (type === 'unhandled') {
return `Route: '${route}'\n${error.stack}`
} else {

View File

@ -23,6 +23,7 @@ module.exports = {
string: 'Nuxt.js'
},
build: {
extractCSS: true,
publicPath: '/orion/',
analyze: {
analyzerMode: 'disabled',

View File

@ -87,7 +87,7 @@ test('/test/about-bis (added with extendRoutes)', async t => {
test('Check stats.json generated by build.analyze', t => {
const stats = require(resolve(__dirname, 'fixtures/with-config/.nuxt/dist/stats.json'))
t.is(stats.assets.length, 27)
t.is(stats.assets.length, 29)
})
// Close server and ask nuxt to stop listening to file changes