mirror of https://github.com/nuxt/nuxt.git
hide fancy errors during test
This commit is contained in:
parent
42a23f98d1
commit
1ee08ad101
|
@ -40,6 +40,7 @@ export default class Builder {
|
||||||
this.filesWatcher = null
|
this.filesWatcher = null
|
||||||
this.customFilesWatcher = null
|
this.customFilesWatcher = null
|
||||||
this.spinner = createSpinner()
|
this.spinner = createSpinner()
|
||||||
|
this.spinner.enabled = !this.options.test
|
||||||
|
|
||||||
// Mute stats on dev
|
// Mute stats on dev
|
||||||
this.webpackStats = this.options.dev ? false : this.options.build.stats
|
this.webpackStats = this.options.dev ? false : this.options.build.stats
|
||||||
|
|
|
@ -21,6 +21,7 @@ export default class Generator {
|
||||||
)
|
)
|
||||||
|
|
||||||
this.spinner = createSpinner()
|
this.spinner = createSpinner()
|
||||||
|
this.spinner.enabled = !this.options.test
|
||||||
}
|
}
|
||||||
|
|
||||||
async generate({ build = true, init = true } = {}) {
|
async generate({ build = true, init = true } = {}) {
|
||||||
|
|
|
@ -126,6 +126,7 @@ export default function webpackBaseConfig({ name, isServer }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build progress indicator
|
// Build progress indicator
|
||||||
|
if (!this.options.test) {
|
||||||
if (this.options.build.profile) {
|
if (this.options.build.profile) {
|
||||||
config.plugins.push(new webpack.ProgressPlugin({ profile: true }))
|
config.plugins.push(new webpack.ProgressPlugin({ profile: true }))
|
||||||
} else {
|
} else {
|
||||||
|
@ -135,6 +136,7 @@ export default function webpackBaseConfig({ name, isServer }) {
|
||||||
color: isServer ? 'green' : 'darkgreen'
|
color: isServer ? 'green' : 'darkgreen'
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Add timefix-plugin before others plugins
|
// Add timefix-plugin before others plugins
|
||||||
if (this.options.dev) {
|
if (this.options.dev) {
|
||||||
|
|
|
@ -86,9 +86,11 @@ export default function webpackClientConfig() {
|
||||||
this.options.build.stats !== 'errors-only'
|
this.options.build.stats !== 'errors-only'
|
||||||
|
|
||||||
// Add friendly error plugin
|
// Add friendly error plugin
|
||||||
|
if (!this.options.test) {
|
||||||
config.plugins.push(
|
config.plugins.push(
|
||||||
new FriendlyErrorsWebpackPlugin({ clearConsole: shouldClearConsole })
|
new FriendlyErrorsWebpackPlugin({ clearConsole: shouldClearConsole })
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// Optimization
|
// Optimization
|
||||||
config.optimization.splitChunks = {
|
config.optimization.splitChunks = {
|
||||||
|
@ -182,7 +184,7 @@ export default function webpackClientConfig() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://github.com/webpack-contrib/webpack-stylish
|
// https://github.com/webpack-contrib/webpack-stylish
|
||||||
if (!this.options.dev) {
|
if (!this.options.dev && !this.options.test) {
|
||||||
config.plugins.push(new StylishPlugin())
|
config.plugins.push(new StylishPlugin())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ export default {
|
||||||
mode: 'universal',
|
mode: 'universal',
|
||||||
dev: process.env.NODE_ENV !== 'production',
|
dev: process.env.NODE_ENV !== 'production',
|
||||||
debug: undefined, // Will be equal to dev if not provided
|
debug: undefined, // Will be equal to dev if not provided
|
||||||
|
test: process.env.NODE_ENV === 'test',
|
||||||
buildDir: '.nuxt',
|
buildDir: '.nuxt',
|
||||||
cacheDir: '.cache',
|
cacheDir: '.cache',
|
||||||
nuxtDir: path.resolve(__dirname, '../..'),
|
nuxtDir: path.resolve(__dirname, '../..'),
|
||||||
|
|
Loading…
Reference in New Issue