Skip to content

Interface: LogCollection

@termwright/test


@termwright/test / LogCollection

Defined in: test/src/logs.ts:42

Everything a test can ask of its logs.

all(): readonly CapturedLog[]

Defined in: test/src/logs.ts:44

Every entry, oldest first.

readonly CapturedLog[]


clear(): void

Defined in: test/src/logs.ts:53

Forgets everything captured so far.

void


dropped(): number

Defined in: test/src/logs.ts:55

Entries dropped after this collection reached its bounded capacity.

number


filter(query?): readonly CapturedLog[]

Defined in: test/src/logs.ts:46

The entries a query selects, oldest first.

LogQuery

readonly CapturedLog[]


lostRecords(): number

Defined in: test/src/logs.ts:63

Log entries that never reached this test: the sum of count over the session’s log-dropped diagnostics.

A refused duplicate carries no count and is not counted — it was not a loss, since the record it repeated did arrive.

number


noteLostRecords(count): void

Defined in: test/src/logs.ts:67

Adds to lostRecords. Used by collectLogs.

number

void


push(entry): void

Defined in: test/src/logs.ts:65

Appends an entry. Used by the fixtures; tests read rather than write.

CapturedLog

void


revision(): number

Defined in: test/src/logs.ts:69

Monotonic collection revision for race-free matcher waits.

number


text(query?): string

Defined in: test/src/logs.ts:51

Entries rendered one per line, without timestamps, sequence numbers or revisions — stable enough to put in a snapshot.

LogQuery

string


waitForChange(after, timeout): Promise<void>

Defined in: test/src/logs.ts:71

Arms first, then checks whether after was already superseded.

number

number

Promise<void>