Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/terminal > StringBufferTerminalProvider

StringBufferTerminalProvider class

This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Terminal provider that stores written data in buffers separated by severity. This terminal provider is designed to be used when code that prints to a terminal is being unit tested.

Signature:

export declare class StringBufferTerminalProvider implements ITerminalProvider 

Implements: ITerminalProvider

Constructors

Constructor

Modifiers

Description

(constructor)(supportsColor)

(BETA) Constructs a new instance of the StringBufferTerminalProvider class

Properties

Property

Modifiers

Type

Description

eolCharacter

readonly

string

(BETA) This property should return the newline character the terminal provider expects.

supportsColor

readonly

boolean

(BETA) This property should return true only if the terminal provider supports rendering console colors.

Methods

Method

Modifiers

Description

getAllOutput(sparse, options)

(BETA) Get everything that has been written at all severity levels.

getAllOutput(sparse, options)

(BETA)

getAllOutputAsChunks(options)

(BETA) Get everything that has been written as an array of output chunks, preserving order.

getAllOutputAsChunks(options)

(BETA)

getDebugOutput(options)

(BETA) Get everything that has been written at debug-level severity.

getErrorOutput(options)

(BETA) Get everything that has been written at error-level severity.

getOutput(options)

(BETA) Get everything that has been written at log-level severity.

getVerbose(options)

(BETA)

getVerboseOutput(options)

(BETA) Get everything that has been written at verbose-level severity.

getWarningOutput(options)

(BETA) Get everything that has been written at warning-level severity.

write(text, severity)

(BETA) This function gets called on every terminal provider upon every message function call on the terminal instance.