API reference › @evolu/common › Console › TestConsole
Defined in: packages/common/src/Console.ts:363
A test console that captures all output for assertions.
Use as a drop-in replacement for Console in tests.
Extends
Properties
child
readonly child: (name: string) => Console;
Defined in: packages/common/src/Console.ts:130
Creates a child console with the given name added to the path.
Child inherits the parent's configured level (not any runtime override). Use Console.children to access all children for batch operations.
Inherited from
children
readonly children: ReadonlySet<Console>;
Defined in: packages/common/src/Console.ts:103
Child consoles created via Console.child.
Inherited from
clearEntries
readonly clearEntries: () => void;
Defined in: packages/common/src/Console.ts:368
Clears all captured entries.
count
readonly count: (label?: string) => void;
Defined in: packages/common/src/Console.ts:166
Increments and logs a counter. Level: debug.
Inherited from
countReset
readonly countReset: (label?: string) => void;
Defined in: packages/common/src/Console.ts:169
Resets a counter. Level: debug.
Inherited from
debug
readonly debug: (...args: readonly unknown[]) => void;
Defined in: packages/common/src/Console.ts:136
Development diagnostics.
Inherited from
dir
readonly dir: (item: unknown) => void;
Defined in: packages/common/src/Console.ts:151
Displays an object with expandable properties. Level: debug.
Inherited from
error
readonly error: (...args: readonly unknown[]) => void;
Defined in: packages/common/src/Console.ts:148
Failures requiring immediate attention.
Inherited from
getEntriesSnapshot
readonly getEntriesSnapshot: () => readonly ConsoleEntry[];
Defined in: packages/common/src/Console.ts:365
Gets all captured entries and clears the internal buffer.
getLevel
readonly getLevel: () => ConsoleLevel;
Defined in: packages/common/src/Console.ts:111
Returns the effective log level.
If this console has its own level set via Console.setLevel, returns that. Otherwise returns the inherited level from creation time.
Inherited from
hasOwnLevel
readonly hasOwnLevel: () => boolean;
Defined in: packages/common/src/Console.ts:122
Returns true if this console has its own level set (not inherited).
Inherited from
info
readonly info: (...args: readonly unknown[]) => void;
Defined in: packages/common/src/Console.ts:142
Operational milestones (startup, shutdown).
Inherited from
log
readonly log: (...args: readonly unknown[]) => void;
Defined in: packages/common/src/Console.ts:139
General-purpose messages.
Inherited from
name
readonly name: string;
Defined in: packages/common/src/Console.ts:100
Name of this console. Empty for root.
Inherited from
setLevel
readonly setLevel: (level:
| ConsoleLevel
| null) => void;
Defined in: packages/common/src/Console.ts:119
Sets the log level for this console.
Pass a level to override the inherited level, or null to revert to the
inherited level.
Inherited from
table
readonly table: (data: unknown) => void;
Defined in: packages/common/src/Console.ts:154
Displays tabular data. Level: debug.
Inherited from
time
readonly time: (label: string) => void;
Defined in: packages/common/src/Console.ts:157
Starts a timer with the given label. Level: debug.
Inherited from
timeEnd
readonly timeEnd: (label: string) => void;
Defined in: packages/common/src/Console.ts:163
Ends a timer and logs elapsed time. Level: debug.
Inherited from
timeLog
readonly timeLog: (label: string, ...args: readonly unknown[]) => void;
Defined in: packages/common/src/Console.ts:160
Logs elapsed time for a timer. Level: debug.
Inherited from
trace
readonly trace: (...args: readonly unknown[]) => void;
Defined in: packages/common/src/Console.ts:133
Outputs a stack trace.
Inherited from
warn
readonly warn: (...args: readonly unknown[]) => void;
Defined in: packages/common/src/Console.ts:145
Recoverable issues that may need attention.
Inherited from
write
readonly write: (entry: ConsoleEntry) => void;
Defined in: packages/common/src/Console.ts:176
Writes a pre-built ConsoleEntry directly to the output, bypassing level filtering. Used to replay entries from another context (e.g., a SharedWorker) where filtering was already applied.