Skip to content

Latest commit

 

History

History
145 lines (88 loc) · 2.13 KB

mockOutputFactory.md

File metadata and controls

145 lines (88 loc) · 2.13 KB

elections-cpl.api.hscc.bdpa.orgDocs


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

Function: mockOutputFactory()

mockOutputFactory(options): (fn, options?) => Promise<void>

Parameters

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

Function

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:532