mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
Update tests
This commit is contained in:
parent
64abcc04a8
commit
ac836c77de
@ -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 {
|
||||
|
1
test/fixtures/with-config/nuxt.config.js
vendored
1
test/fixtures/with-config/nuxt.config.js
vendored
@ -23,6 +23,7 @@ module.exports = {
|
||||
string: 'Nuxt.js'
|
||||
},
|
||||
build: {
|
||||
extractCSS: true,
|
||||
publicPath: '/orion/',
|
||||
analyze: {
|
||||
analyzerMode: 'disabled',
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user