Skip to content

Test Renderer

TestRenderer is intended to use in tests and provides a per-line JSON format output, that is configurable through the renderer options.

This JSON format specific can be seen here, but needs a better understanding of internal workings of this library.

Renderer Options

Details

Documentation / listr2 / ListrTestRendererOptions

Interface: ListrTestRendererOptions

Extends

Properties

subtasks?

optional subtasks: boolean

Log subtasks.

Default Value

true

Defined in

packages/listr2/src/renderer/test/renderer.interface.ts:15


state?

optional state: ListrTaskState[]

Log given task states.

Defined in

packages/listr2/src/renderer/test/renderer.interface.ts:19


output?

optional output: boolean

Log output.

Defined in

packages/listr2/src/renderer/test/renderer.interface.ts:23


prompt?

optional prompt: boolean

Log prompt.

Defined in

packages/listr2/src/renderer/test/renderer.interface.ts:27


title?

optional title: boolean

Log title changes.

Defined in

packages/listr2/src/renderer/test/renderer.interface.ts:31


messages?

optional messages: keyof ListrTaskMessage[]

Log given messages.

Defined in

packages/listr2/src/renderer/test/renderer.interface.ts:35


messagesToStderr?

optional messagesToStderr: keyof ListrTaskMessage[]

Log given messages to stderr instead of stdout.

Defined in

packages/listr2/src/renderer/test/renderer.interface.ts:39


task?

optional task: false | TestRendererSerializerTaskKeys[]

Serialize the given properties of the task inside the logs.

Defined in

packages/listr2/src/renderer/test/renderer.interface.ts:43


logger?

optional logger: ListrLogger<ListrLogLevels>

Inject your custom implementation of the ListrLogger.

See

https://listr2.kilic.dev/renderer/logger.html

Inherited from

RendererLoggerOptions.logger

Defined in

packages/listr2/src/utils/logger/logger.interface.ts:82