elections-cpl.api.hscc.bdpa.org • Docs
elections-cpl.api.hscc.bdpa.org / test/setup / withMockedOutput
withMockedOutput(
fn
,options
?):Promise
<void
>
Any output generated within fn
will be captured by an output spy instead of
emitting to the console (stdout/stderr).
However, not that stdErrSpy
is set to passthrough mode by default. If
desired, use the passthrough
option to prevent this.
• fn
• options?
• options.passthrough?
Determine if spies provide mock implementations for output functions, thus preventing any output to the terminal, or if spies should passthrough output as normal.
Passthrough is disabled for all spies by default (except stdErrSpy
).
Pass true
to enable passthrough for a specific spy.
• options.passthrough.errorSpy?: boolean
Default
false
• options.passthrough.infoSpy?: boolean
Default
false
• options.passthrough.logSpy?: boolean
Default
false
• options.passthrough.stdErrSpy?: boolean
Default
true
• options.passthrough.stdoutSpy?: boolean
Default
false
• options.passthrough.warnSpy?: boolean
Default
false
Promise
<void
>