From e8776835cbb577ecdef7077448019c1839f84c6f Mon Sep 17 00:00:00 2001 From: ehmicky Date: Fri, 10 Dec 2021 17:10:26 +0100 Subject: [PATCH] feat: add a verbose flag --- packages/build/src/core/flags.js | 7 +- packages/build/src/core/main.js | 10 ++ packages/build/src/core/normalize_flags.js | 1 + packages/build/src/log/messages/ipc.js | 50 +++++++ packages/build/src/plugins/child/error.js | 4 +- packages/build/src/plugins/child/load.js | 4 +- packages/build/src/plugins/child/main.js | 23 ++- packages/build/src/plugins/child/run.js | 10 +- packages/build/src/plugins/ipc.js | 20 ++- packages/build/src/plugins/load.js | 18 ++- packages/build/src/steps/plugin.js | 15 +- packages/build/src/steps/run_step.js | 4 + packages/build/src/steps/run_steps.js | 2 + .../tests/log/fixtures/verbose/manifest.yml | 2 + .../tests/log/fixtures/verbose/netlify.toml | 2 + .../tests/log/fixtures/verbose/plugin.js | 7 + .../log/fixtures/verbose_error/manifest.yml | 2 + .../log/fixtures/verbose_error/netlify.toml | 2 + .../log/fixtures/verbose_error/plugin.js | 7 + .../build/tests/log/snapshots/tests.js.md | 141 ++++++++++++++++++ .../build/tests/log/snapshots/tests.js.snap | Bin 520 -> 996 bytes packages/build/tests/log/tests.js | 8 + 22 files changed, 310 insertions(+), 29 deletions(-) create mode 100644 packages/build/src/log/messages/ipc.js create mode 100644 packages/build/tests/log/fixtures/verbose/manifest.yml create mode 100644 packages/build/tests/log/fixtures/verbose/netlify.toml create mode 100644 packages/build/tests/log/fixtures/verbose/plugin.js create mode 100644 packages/build/tests/log/fixtures/verbose_error/manifest.yml create mode 100644 packages/build/tests/log/fixtures/verbose_error/netlify.toml create mode 100644 packages/build/tests/log/fixtures/verbose_error/plugin.js diff --git a/packages/build/src/core/flags.js b/packages/build/src/core/flags.js index d35fea64d1..4590887db6 100644 --- a/packages/build/src/core/flags.js +++ b/packages/build/src/core/flags.js @@ -134,7 +134,12 @@ Default: false`, }, debug: { boolean: true, - describe: 'Print debugging information', + describe: 'Print user-facing debugging information', + hidden: true, + }, + verbose: { + boolean: true, + describe: 'Print internal debugging information', hidden: true, }, sendStatus: { diff --git a/packages/build/src/core/main.js b/packages/build/src/core/main.js index debec18cd0..c925247ee7 100644 --- a/packages/build/src/core/main.js +++ b/packages/build/src/core/main.js @@ -163,6 +163,7 @@ const tExecBuild = async function ({ baseRelDir, env: envOpt, debug, + verbose, nodePath, functionsDistDir, cacheDir, @@ -273,6 +274,7 @@ const tExecBuild = async function ({ errorParams, logs, debug, + verbose, timers: timersA, sendStatus, saveConfig, @@ -321,6 +323,7 @@ const runAndReportBuild = async function ({ errorParams, logs, debug, + verbose, timers, sendStatus, saveConfig, @@ -360,6 +363,7 @@ const runAndReportBuild = async function ({ errorParams, logs, debug, + verbose, timers, sendStatus, saveConfig, @@ -451,6 +455,7 @@ const initAndRunBuild = async function ({ errorParams, logs, debug, + verbose, sendStatus, saveConfig, timers, @@ -521,6 +526,7 @@ const initAndRunBuild = async function ({ errorParams, logs, debug, + verbose, saveConfig, timers: timersB, testOpts, @@ -573,6 +579,7 @@ const runBuild = async function ({ errorParams, logs, debug, + verbose, saveConfig, timers, testOpts, @@ -583,7 +590,9 @@ const runBuild = async function ({ childProcesses, packageJson, timers, + logs, debug, + verbose, }) const { steps, events } = getSteps(pluginsSteps) @@ -623,6 +632,7 @@ const runBuild = async function ({ configOpts, logs, debug, + verbose, saveConfig, timers: timersA, testOpts, diff --git a/packages/build/src/core/normalize_flags.js b/packages/build/src/core/normalize_flags.js index 3022f3ebe1..753ff294fa 100644 --- a/packages/build/src/core/normalize_flags.js +++ b/packages/build/src/core/normalize_flags.js @@ -41,6 +41,7 @@ const getDefaultFlags = function ({ env: envOpt = {} }, combinedEnv) { mode: REQUIRE_MODE, offline: false, telemetry: false, + verbose: Boolean(combinedEnv.NETLIFY_BUILD_DEBUG), functionsDistDir: DEFAULT_FUNCTIONS_DIST, cacheDir: DEFAULT_CACHE_DIR, deployId: combinedEnv.DEPLOY_ID, diff --git a/packages/build/src/log/messages/ipc.js b/packages/build/src/log/messages/ipc.js new file mode 100644 index 0000000000..58720bcc7e --- /dev/null +++ b/packages/build/src/log/messages/ipc.js @@ -0,0 +1,50 @@ +'use strict' + +const { log } = require('../logger') + +const logVerbose = function (logs, verbose, message) { + if (!verbose) { + return + } + + log(logs, message) +} + +const logSendingEventToChild = function (logs, verbose) { + logVerbose(logs, verbose, 'Step starting.') +} + +const logSentEventToChild = function (logs, verbose) { + logVerbose(logs, verbose, 'Step started.') +} + +const logPluginMethodStart = function (verbose) { + logVerbose(undefined, verbose, 'Plugin logic started.') +} + +const logPluginMethodEnd = function (verbose) { + logVerbose(undefined, verbose, 'Plugin logic ended.') +} + +const logSendingEventToParent = function (verbose, error) { + const message = error instanceof Error ? `Step erroring.\n${error.stack}` : 'Stop closing.' + logVerbose(undefined, verbose, message) +} + +const logReceivedEventFromChild = function (logs, verbose) { + logVerbose(logs, verbose, 'Step ended.') +} + +const logStepCompleted = function (logs, verbose) { + logVerbose(logs, verbose, 'Step completed.') +} + +module.exports = { + logSendingEventToChild, + logSentEventToChild, + logPluginMethodStart, + logPluginMethodEnd, + logSendingEventToParent, + logReceivedEventFromChild, + logStepCompleted, +} diff --git a/packages/build/src/plugins/child/error.js b/packages/build/src/plugins/child/error.js index 77286f77d2..8d69bee983 100644 --- a/packages/build/src/plugins/child/error.js +++ b/packages/build/src/plugins/child/error.js @@ -8,11 +8,11 @@ const { normalizeError } = require('../../error/parse/normalize') const { sendEventToParent } = require('../ipc') // Handle any top-level error and communicate it back to parent -const handleError = async function (error) { +const handleError = async function (error, verbose) { const errorA = normalizeError(error) addDefaultErrorInfo(errorA, { type: 'pluginInternal' }) const errorPayload = errorToJson(errorA) - await sendEventToParent('error', errorPayload) + await sendEventToParent('error', errorPayload, verbose, errorA) } // On uncaught exceptions and unhandled rejections, print the stack trace. diff --git a/packages/build/src/plugins/child/load.js b/packages/build/src/plugins/child/load.js index 44b200f7ab..5d2eaf6498 100644 --- a/packages/build/src/plugins/child/load.js +++ b/packages/build/src/plugins/child/load.js @@ -11,7 +11,7 @@ const { validatePlugin } = require('./validate') // This also validates the plugin. // Do it when parent requests it using the `load` event. // Also figure out the list of plugin steps. This is also passed to the parent. -const load = async function ({ pluginPath, inputs, packageJson }) { +const load = async function ({ pluginPath, inputs, packageJson, verbose }) { const tsNodeService = registerTypeScript(pluginPath) const logic = await getLogic({ pluginPath, inputs, tsNodeService }) @@ -21,7 +21,7 @@ const load = async function ({ pluginPath, inputs, packageJson }) { const events = Object.keys(methods) // Context passed to every event handler - const context = { methods, inputs, packageJson } + const context = { methods, inputs, packageJson, verbose } return { events, context } } diff --git a/packages/build/src/plugins/child/main.js b/packages/build/src/plugins/child/main.js index ad85f9d935..d80bac8957 100644 --- a/packages/build/src/plugins/child/main.js +++ b/packages/build/src/plugins/child/main.js @@ -9,33 +9,42 @@ const { run } = require('./run') // Boot plugin child process. const bootPlugin = async function () { + const state = { context: { verbose: false } } + try { handleProcessErrors() setInspectColors() - const state = {} // We need to fire them in parallel because `process.send()` can be slow // to await, i.e. parent might send `load` event before child `ready` event // returns. - await Promise.all([handleEvents(state), sendEventToParent('ready')]) + await Promise.all([handleEvents(state), sendEventToParent('ready', {}, false)]) } catch (error) { - await handleError(error) + await handleError(error, state.context.verbose) } } // Wait for events from parent to perform plugin methods const handleEvents = async function (state) { - await getEventsFromParent((callId, eventName, payload) => handleEvent(callId, eventName, payload, state)) + await getEventsFromParent((callId, eventName, payload) => handleEvent({ callId, eventName, payload, state })) } // Each event can pass `context` information to the next event -const handleEvent = async function (callId, eventName, payload, state) { +const handleEvent = async function ({ + callId, + eventName, + payload, + state, + state: { + context: { verbose }, + }, +}) { try { const { context, ...response } = await EVENTS[eventName](payload, state.context) state.context = { ...state.context, ...context } - await sendEventToParent(callId, response) + await sendEventToParent(callId, response, verbose) } catch (error) { - await handleError(error) + await handleError(error, verbose) } } diff --git a/packages/build/src/plugins/child/run.js b/packages/build/src/plugins/child/run.js index c0c3eab8d3..df8b4a13d7 100644 --- a/packages/build/src/plugins/child/run.js +++ b/packages/build/src/plugins/child/run.js @@ -1,12 +1,16 @@ 'use strict' const { getNewEnvChanges, setEnvChanges } = require('../../env/changes') +const { logPluginMethodStart, logPluginMethodEnd } = require('../../log/messages/ipc') const { cloneNetlifyConfig, getConfigMutations } = require('./diff') const { getUtils } = require('./utils') // Run a specific plugin event handler -const run = async function ({ event, error, constants, envChanges, netlifyConfig }, { methods, inputs, packageJson }) { +const run = async function ( + { event, error, constants, envChanges, netlifyConfig }, + { methods, inputs, packageJson, verbose }, +) { const method = methods[event] const runState = {} const utils = getUtils({ event, constants, runState }) @@ -14,7 +18,11 @@ const run = async function ({ event, error, constants, envChanges, netlifyConfig const runOptions = { utils, constants, inputs, netlifyConfig: netlifyConfigCopy, packageJson, error } const envBefore = setEnvChanges(envChanges) + + logPluginMethodStart(verbose) await method(runOptions) + logPluginMethodEnd(verbose) + const newEnvChanges = getNewEnvChanges(envBefore, netlifyConfig, netlifyConfigCopy) const configMutations = getConfigMutations(netlifyConfig, netlifyConfigCopy, event) diff --git a/packages/build/src/plugins/ipc.js b/packages/build/src/plugins/ipc.js index 2290ab4e34..08687d1b95 100644 --- a/packages/build/src/plugins/ipc.js +++ b/packages/build/src/plugins/ipc.js @@ -8,16 +8,23 @@ const { v4: uuidv4 } = require('uuid') const { jsonToError, errorToJson } = require('../error/build') const { addErrorInfo } = require('../error/info') +const { + logSendingEventToChild, + logSentEventToChild, + logReceivedEventFromChild, + logSendingEventToParent, +} = require('../log/messages/ipc') // Send event from child to parent process then wait for response // We need to fire them in parallel because `process.send()` can be slow // to await, i.e. child might send response before parent start listening for it -const callChild = async function (childProcess, eventName, payload) { +const callChild = async function ({ childProcess, eventName, payload, logs, verbose }) { const callId = uuidv4() const [response] = await Promise.all([ getEventFromChild(childProcess, callId), - sendEventToChild(childProcess, callId, eventName, payload), + sendEventToChild({ childProcess, callId, eventName, payload, logs, verbose }), ]) + logReceivedEventFromChild(logs, verbose) return response } @@ -84,9 +91,13 @@ Plugin methods should instead: - on failure: call utils.build.failPlugin() or utils.build.failBuild()` // Send event from parent to child process -const sendEventToChild = async function (childProcess, callId, eventName, payload) { +const sendEventToChild = async function ({ childProcess, callId, eventName, payload, logs, verbose }) { + logSendingEventToChild(logs, verbose) + const payloadA = serializePayload(payload) await promisify(childProcess.send.bind(childProcess))([callId, eventName, payloadA]) + + logSentEventToChild(logs, verbose) } // Respond to events from parent to child process. @@ -109,7 +120,8 @@ const getEventsFromParent = function (callback) { } // Send event from child to parent process -const sendEventToParent = async function (callId, payload) { +const sendEventToParent = async function (callId, payload, verbose, error) { + logSendingEventToParent(verbose, error) await promisify(process.send.bind(process))([callId, payload]) } diff --git a/packages/build/src/plugins/load.js b/packages/build/src/plugins/load.js index 0f96fa2b7d..8ffe97f102 100644 --- a/packages/build/src/plugins/load.js +++ b/packages/build/src/plugins/load.js @@ -8,16 +8,16 @@ const { callChild } = require('./ipc') // Retrieve all plugins steps // Can use either a module name or a file path to the plugin. -const loadPlugins = async function ({ pluginsOptions, childProcesses, packageJson, timers, debug }) { +const loadPlugins = async function ({ pluginsOptions, childProcesses, packageJson, timers, logs, debug, verbose }) { return pluginsOptions.length === 0 ? { pluginsSteps: [], timers } - : await loadAllPlugins({ pluginsOptions, childProcesses, packageJson, timers, debug }) + : await loadAllPlugins({ pluginsOptions, childProcesses, packageJson, timers, logs, debug, verbose }) } -const tLoadAllPlugins = async function ({ pluginsOptions, childProcesses, packageJson, debug }) { +const tLoadAllPlugins = async function ({ pluginsOptions, childProcesses, packageJson, logs, debug, verbose }) { const pluginsSteps = await Promise.all( pluginsOptions.map((pluginOptions, index) => - loadPlugin(pluginOptions, { childProcesses, index, packageJson, debug }), + loadPlugin(pluginOptions, { childProcesses, index, packageJson, logs, debug, verbose }), ), ) const pluginsStepsA = pluginsSteps.flat() @@ -31,13 +31,19 @@ const loadAllPlugins = measureDuration(tLoadAllPlugins, 'load_plugins') // Do it by executing the plugin `load` event handler. const loadPlugin = async function ( { packageName, pluginPackageJson, pluginPackageJson: { version } = {}, pluginPath, inputs, loadedFrom, origin }, - { childProcesses, index, packageJson, debug }, + { childProcesses, index, packageJson, logs, debug, verbose }, ) { const { childProcess } = childProcesses[index] const loadEvent = 'load' try { - const { events } = await callChild(childProcess, 'load', { pluginPath, inputs, packageJson }) + const { events } = await callChild({ + childProcess, + eventName: 'load', + payload: { pluginPath, inputs, packageJson, verbose }, + logs, + verbose: false, + }) const pluginSteps = events.map((event) => ({ event, packageName, diff --git a/packages/build/src/steps/plugin.js b/packages/build/src/steps/plugin.js index d64dc41aed..cbebcd9ccc 100644 --- a/packages/build/src/steps/plugin.js +++ b/packages/build/src/steps/plugin.js @@ -1,6 +1,7 @@ 'use strict' const { addErrorInfo } = require('../error/info') +const { logStepCompleted } = require('../log/messages/ipc') const { pipePluginOutput, unpipePluginOutput } = require('../log/stream') const { callChild } = require('../plugins/ipc') const { getSuccessStatus } = require('../status/success') @@ -28,6 +29,7 @@ const firePluginStep = async function ({ error, logs, debug, + verbose, }) { const listeners = pipePluginOutput(childProcess, logs) @@ -37,12 +39,12 @@ const firePluginStep = async function ({ newEnvChanges, configMutations: newConfigMutations, status, - } = await callChild(childProcess, 'run', { - event, - error, - envChanges, - netlifyConfig, - constants, + } = await callChild({ + childProcess, + eventName: 'run', + payload: { event, error, envChanges, netlifyConfig, constants }, + logs, + verbose, }) const { netlifyConfig: netlifyConfigA, @@ -80,6 +82,7 @@ const firePluginStep = async function ({ return { newError } } finally { await unpipePluginOutput(childProcess, logs, listeners) + logStepCompleted(logs, verbose) } } diff --git a/packages/build/src/steps/run_step.js b/packages/build/src/steps/run_step.js index 3313958a00..522063c293 100644 --- a/packages/build/src/steps/run_step.js +++ b/packages/build/src/steps/run_step.js @@ -50,6 +50,7 @@ const runStep = async function ({ redirectsPath, logs, debug, + verbose, saveConfig, timers, testOpts, @@ -110,6 +111,7 @@ const runStep = async function ({ error, logs, debug, + verbose, saveConfig, timers, errorParams, @@ -237,6 +239,7 @@ const tFireStep = function ({ error, logs, debug, + verbose, saveConfig, errorParams, configOpts, @@ -293,6 +296,7 @@ const tFireStep = function ({ error, logs, debug, + verbose, }) } diff --git a/packages/build/src/steps/run_steps.js b/packages/build/src/steps/run_steps.js index 723567c4a2..9c40b51a13 100644 --- a/packages/build/src/steps/run_steps.js +++ b/packages/build/src/steps/run_steps.js @@ -36,6 +36,7 @@ const runSteps = async function ({ configOpts, logs, debug, + verbose, saveConfig, timers, testOpts, @@ -128,6 +129,7 @@ const runSteps = async function ({ redirectsPath: redirectsPathA, logs, debug, + verbose, saveConfig, timers: timersA, testOpts, diff --git a/packages/build/tests/log/fixtures/verbose/manifest.yml b/packages/build/tests/log/fixtures/verbose/manifest.yml new file mode 100644 index 0000000000..a3512f0259 --- /dev/null +++ b/packages/build/tests/log/fixtures/verbose/manifest.yml @@ -0,0 +1,2 @@ +name: test +inputs: [] diff --git a/packages/build/tests/log/fixtures/verbose/netlify.toml b/packages/build/tests/log/fixtures/verbose/netlify.toml new file mode 100644 index 0000000000..81b0ce8bb1 --- /dev/null +++ b/packages/build/tests/log/fixtures/verbose/netlify.toml @@ -0,0 +1,2 @@ +[[plugins]] +package = "./plugin" diff --git a/packages/build/tests/log/fixtures/verbose/plugin.js b/packages/build/tests/log/fixtures/verbose/plugin.js new file mode 100644 index 0000000000..0ebbd8696d --- /dev/null +++ b/packages/build/tests/log/fixtures/verbose/plugin.js @@ -0,0 +1,7 @@ +'use strict' + +module.exports = { + onPreBuild() { + console.log('test') + }, +} diff --git a/packages/build/tests/log/fixtures/verbose_error/manifest.yml b/packages/build/tests/log/fixtures/verbose_error/manifest.yml new file mode 100644 index 0000000000..a3512f0259 --- /dev/null +++ b/packages/build/tests/log/fixtures/verbose_error/manifest.yml @@ -0,0 +1,2 @@ +name: test +inputs: [] diff --git a/packages/build/tests/log/fixtures/verbose_error/netlify.toml b/packages/build/tests/log/fixtures/verbose_error/netlify.toml new file mode 100644 index 0000000000..81b0ce8bb1 --- /dev/null +++ b/packages/build/tests/log/fixtures/verbose_error/netlify.toml @@ -0,0 +1,2 @@ +[[plugins]] +package = "./plugin" diff --git a/packages/build/tests/log/fixtures/verbose_error/plugin.js b/packages/build/tests/log/fixtures/verbose_error/plugin.js new file mode 100644 index 0000000000..d895009d38 --- /dev/null +++ b/packages/build/tests/log/fixtures/verbose_error/plugin.js @@ -0,0 +1,7 @@ +'use strict' + +module.exports = { + onPreBuild() { + throw new Error('test') + }, +} diff --git a/packages/build/tests/log/snapshots/tests.js.md b/packages/build/tests/log/snapshots/tests.js.md index c8bf7aa3e1..3874809181 100644 --- a/packages/build/tests/log/snapshots/tests.js.md +++ b/packages/build/tests/log/snapshots/tests.js.md @@ -64,3 +64,144 @@ Generated by [AVA](https://avajs.dev). publishOrigin: default␊ ␊ node: bad option: --invalid` + +## The verbose flag enables verbosity + +> Snapshot 1 + + `␊ + ────────────────────────────────────────────────────────────────␊ + Netlify Build ␊ + ────────────────────────────────────────────────────────────────␊ + ␊ + > Version␊ + @netlify/build 1.0.0␊ + ␊ + > Flags␊ + debug: true␊ + repositoryRoot: packages/build/tests/log/fixtures/verbose␊ + testOpts:␊ + pluginsListUrl: test␊ + silentLingeringProcesses: true␊ + verbose: true␊ + ␊ + > Current directory␊ + packages/build/tests/log/fixtures/verbose␊ + ␊ + > Config file␊ + packages/build/tests/log/fixtures/verbose/netlify.toml␊ + ␊ + > Resolved config␊ + build:␊ + publish: packages/build/tests/log/fixtures/verbose␊ + publishOrigin: default␊ + plugins:␊ + - inputs: {}␊ + origin: config␊ + package: ./plugin␊ + ␊ + > Context␊ + production␊ + ␊ + > Loading plugins␊ + - ./plugin@1.0.0 from netlify.toml␊ + ␊ + ────────────────────────────────────────────────────────────────␊ + 1. ./plugin (onPreBuild event) ␊ + ────────────────────────────────────────────────────────────────␊ + ␊ + Step starting.␊ + Step started.␊ + Plugin logic started.␊ + test␊ + Plugin logic ended.␊ + Stop closing.␊ + Step ended.␊ + Step completed.␊ + ␊ + (./plugin onPreBuild completed in 1ms)␊ + ␊ + ────────────────────────────────────────────────────────────────␊ + Netlify Build Complete ␊ + ────────────────────────────────────────────────────────────────␊ + ␊ + (Netlify Build completed in 1ms)` + +## Verbosity works with plugin errors + +> Snapshot 1 + + `␊ + ────────────────────────────────────────────────────────────────␊ + Netlify Build ␊ + ────────────────────────────────────────────────────────────────␊ + ␊ + > Version␊ + @netlify/build 1.0.0␊ + ␊ + > Flags␊ + debug: true␊ + repositoryRoot: packages/build/tests/log/fixtures/verbose_error␊ + testOpts:␊ + pluginsListUrl: test␊ + silentLingeringProcesses: true␊ + verbose: true␊ + ␊ + > Current directory␊ + packages/build/tests/log/fixtures/verbose_error␊ + ␊ + > Config file␊ + packages/build/tests/log/fixtures/verbose_error/netlify.toml␊ + ␊ + > Resolved config␊ + build:␊ + publish: packages/build/tests/log/fixtures/verbose_error␊ + publishOrigin: default␊ + plugins:␊ + - inputs: {}␊ + origin: config␊ + package: ./plugin␊ + ␊ + > Context␊ + production␊ + ␊ + > Loading plugins␊ + - ./plugin@1.0.0 from netlify.toml␊ + ␊ + ────────────────────────────────────────────────────────────────␊ + 1. ./plugin (onPreBuild event) ␊ + ────────────────────────────────────────────────────────────────␊ + ␊ + Step starting.␊ + Step started.␊ + Plugin logic started.␊ + Step erroring.␊ + Error: test␊ + STACK TRACE␊ + Step completed.␊ + ␊ + ────────────────────────────────────────────────────────────────␊ + Plugin "./plugin" internal error ␊ + ────────────────────────────────────────────────────────────────␊ + ␊ + Error message␊ + Error: test␊ + ␊ + Plugin details␊ + Package: ./plugin␊ + Version: 1.0.0␊ + Repository: git+https://github.com/netlify/build.git␊ + Report issues: https://github.com/netlify/build/issues␊ + ␊ + Error location␊ + In "onPreBuild" event in "./plugin" from netlify.toml␊ + STACK TRACE␊ + ␊ + Resolved config␊ + build:␊ + publish: packages/build/tests/log/fixtures/verbose_error␊ + publishOrigin: default␊ + plugins:␊ + - inputs: {}␊ + origin: config␊ + package: ./plugin` diff --git a/packages/build/tests/log/snapshots/tests.js.snap b/packages/build/tests/log/snapshots/tests.js.snap index c942873a5cd0677eb9c7bb293fcb334f468f232a..8a42a0dee933128df6ea028982210379562fb308 100644 GIT binary patch literal 996 zcmV3G|Xf8RD|_m;~$N?-3>@9Iwp;4D#$Ru|wzN?8Q$UfqvC={TGx zLQ)brHhTS9X5&gzV7Str#BT`9gJ}8kAd=ez#k}571rZ`tVBtdv3s1a$s zJw>FF9^*ByO6OH7(9j^F!lm}r#)(8pzocPISX!g89H&y96U;YOV~~`QSdG)TMg)FM z3LX+Ei7eKTMa-UYspV7%bb*Kp66&?#OKV@44#49otw9xMZpYQjpmPlD>a~*1Q=WMgYcbL6 z+&;LT_0P7i$h?Uuc$9`pX9kXs^B}?#$Y&~J_ z@uVP@D@X(LZ16u|h-pO8Ry=`_A#W6+ z3Jczcyq+*(LX-vy)R%!?yns0l!*w~>6Dii*gv!|-|Dz@}(2PLKDK`m^y*+s5?OxrF zKqrL9MIr-gDM&iP9GilqeL-TChR$2#GN$jcLZ6-)EuVpz zsnPOSs|e}%Za1DT86f?6&h%q7Dk9>5SwMO|T>#8+Lmjyr=_P;8j(-WEh^T-v%_NgK z5oK4wN09fd!em<&AjjrC$(m|Z9iCMxk-q2Q{cKusF|WL)KIft#a}^4xl&Nklu$r4^ z-(1=l<6)p|BR!1=y+jH9mJ^`)_*+?Vc?p;Wb!oq7l8JXW|DWoG>iwHCk<=5l@Z03! zy5*o~Xt$0? z^niNhNf;;T7SRLkjbKGlobfk5pT8L>iegfnFTbDv_;|`+zMZ~!d-mbcq{!>*R#Dt8 z?sngkJH@?QpSPwzKfNFIGX;2sY^Ywt(?mwYP1pDtm_CL#7$P|lLBW?s{ZQxF5Tp4WoR zrUTEhoMsZeNe$V!Pmzy;DLZRth-A?6KG_C?yj}-aVT>4u3?#9=6oMQ9O#!Q%iQulA zMut0EQvha zR#|~trxA8`$O@A5@3w { const defaultConfig = { build: { command: 'node --invalid' } } await runFixture(t, 'empty', { flags: { defaultConfig } }) }) + +test('The verbose flag enables verbosity', async (t) => { + await runFixture(t, 'verbose', { flags: { verbose: true } }) +}) + +test('Verbosity works with plugin errors', async (t) => { + await runFixture(t, 'verbose_error', { flags: { verbose: true } }) +})