Interface: LogCollection
@termwright/test / LogCollection
Interface: LogCollection
Section titled “Interface: LogCollection”Defined in: test/src/logs.ts:42
Everything a test can ask of its logs.
Methods
Section titled “Methods”all(): readonly
CapturedLog[]
Defined in: test/src/logs.ts:44
Every entry, oldest first.
Returns
Section titled “Returns”readonly CapturedLog[]
clear()
Section titled “clear()”clear():
void
Defined in: test/src/logs.ts:53
Forgets everything captured so far.
Returns
Section titled “Returns”void
dropped()
Section titled “dropped()”dropped():
number
Defined in: test/src/logs.ts:55
Entries dropped after this collection reached its bounded capacity.
Returns
Section titled “Returns”number
filter()
Section titled “filter()”filter(
query?): readonlyCapturedLog[]
Defined in: test/src/logs.ts:46
The entries a query selects, oldest first.
Parameters
Section titled “Parameters”query?
Section titled “query?”Returns
Section titled “Returns”readonly CapturedLog[]
lostRecords()
Section titled “lostRecords()”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.
Returns
Section titled “Returns”number
noteLostRecords()
Section titled “noteLostRecords()”noteLostRecords(
count):void
Defined in: test/src/logs.ts:67
Adds to lostRecords. Used by collectLogs.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
push()
Section titled “push()”push(
entry):void
Defined in: test/src/logs.ts:65
Appends an entry. Used by the fixtures; tests read rather than write.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
revision()
Section titled “revision()”revision():
number
Defined in: test/src/logs.ts:69
Monotonic collection revision for race-free matcher waits.
Returns
Section titled “Returns”number
text()
Section titled “text()”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.
Parameters
Section titled “Parameters”query?
Section titled “query?”Returns
Section titled “Returns”string
waitForChange()
Section titled “waitForChange()”waitForChange(
after,timeout):Promise<void>
Defined in: test/src/logs.ts:71
Arms first, then checks whether after was already superseded.
Parameters
Section titled “Parameters”number
timeout
Section titled “timeout”number
Returns
Section titled “Returns”Promise<void>