mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
test: when console has been spied in test, ignore muting in progress plugin
This commit is contained in:
parent
2a931cbad6
commit
4bbc8a91f6
@ -2,7 +2,10 @@ const ProgressBar = require('node-progress-bars')
|
||||
const webpack = require('webpack')
|
||||
|
||||
module.exports = function ProgressPlugin({ color, pcolor, title }) {
|
||||
muteConsole()
|
||||
// eslint-disable-next-line no-console
|
||||
if (!console.spiedInTest) {
|
||||
muteConsole()
|
||||
}
|
||||
|
||||
// https://github.com/bubkoo/ascii-progress
|
||||
const bar = new ProgressBar({
|
||||
|
@ -30,6 +30,7 @@ export function release() {
|
||||
}
|
||||
|
||||
context = null
|
||||
delete console.spiedInTest // eslint-disable-line no-console
|
||||
}
|
||||
|
||||
export async function intercept(levels, msg, cb) {
|
||||
@ -39,6 +40,7 @@ export async function intercept(levels, msg, cb) {
|
||||
)
|
||||
}
|
||||
context = {}
|
||||
console.spiedInTest = true // eslint-disable-line no-console
|
||||
|
||||
if (cb === undefined && typeof msg === 'function') {
|
||||
cb = msg
|
||||
|
Loading…
Reference in New Issue
Block a user