Skip to content

Latest commit

 

History

History
86 lines (52 loc) · 1.52 KB

File metadata and controls

86 lines (52 loc) · 1.52 KB

elections-cpl.api.hscc.bdpa.orgDocs


elections-cpl.api.hscc.bdpa.org / test/setup / withMockedOutput

Function: 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.

Parameters

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

Returns

Promise<void>

Source

test/setup.ts:452