mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 16:12:12 +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 })
|
errors.push({ type: 'handled', route, error })
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
/* istanbul ignore next */
|
||||||
errors.push({ type: 'unhandled', route, error: err })
|
errors.push({ type: 'unhandled', route, error: err })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
var minifiedHtml = minify(html, self.options.generate.minify)
|
var minifiedHtml = minify(html, self.options.generate.minify)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
/* istanbul ignore next */
|
||||||
let minifyErr = new Error(`HTML minification failed. Make sure the route generates valid HTML. Failed HTML:\n ${html}`)
|
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 })
|
errors.push({ type: 'unhandled', route, error: minifyErr })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -137,6 +140,7 @@ export default function () {
|
|||||||
|
|
||||||
if (errors.length) {
|
if (errors.length) {
|
||||||
const report = errors.map(({ type, route, error }) => {
|
const report = errors.map(({ type, route, error }) => {
|
||||||
|
/* istanbul ignore next */
|
||||||
if (type === 'unhandled') {
|
if (type === 'unhandled') {
|
||||||
return `Route: '${route}'\n${error.stack}`
|
return `Route: '${route}'\n${error.stack}`
|
||||||
} else {
|
} else {
|
||||||
|
3
test/fixtures/with-config/nuxt.config.js
vendored
3
test/fixtures/with-config/nuxt.config.js
vendored
@ -23,6 +23,7 @@ module.exports = {
|
|||||||
string: 'Nuxt.js'
|
string: 'Nuxt.js'
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
|
extractCSS: true,
|
||||||
publicPath: '/orion/',
|
publicPath: '/orion/',
|
||||||
analyze: {
|
analyze: {
|
||||||
analyzerMode: 'disabled',
|
analyzerMode: 'disabled',
|
||||||
@ -33,6 +34,6 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
css: [
|
css: [
|
||||||
{src: '~/assets/app.css'}
|
{ src: '~/assets/app.css' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ test('/test/about-bis (added with extendRoutes)', async t => {
|
|||||||
|
|
||||||
test('Check stats.json generated by build.analyze', t => {
|
test('Check stats.json generated by build.analyze', t => {
|
||||||
const stats = require(resolve(__dirname, 'fixtures/with-config/.nuxt/dist/stats.json'))
|
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
|
// Close server and ask nuxt to stop listening to file changes
|
||||||
|
Loading…
Reference in New Issue
Block a user