API reference › @evolu/common › Console › TestConsole
Defined in: packages/common/src/Console.ts:338
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:112
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:85
Child consoles created via Console.child.
Inherited from
clearEntries
readonly clearEntries: () => void;
Defined in: packages/common/src/Console.ts:343
Clears all captured entries.
count
readonly count: (label?: string) => void;
Defined in: packages/common/src/Console.ts:148
Increments and logs a counter. Level: debug.
Inherited from
countReset
readonly countReset: (label?: string) => void;
Defined in: packages/common/src/Console.ts:151
Resets a counter. Level: debug.
Inherited from
debug
readonly debug: (...args: readonly unknown[]) => void;
Defined in: packages/common/src/Console.ts:118
Development diagnostics.
Inherited from
dir
readonly dir: (item: unknown) => void;
Defined in: packages/common/src/Console.ts:133
Displays an object with expandable properties. Level: debug.
Inherited from
error
readonly error: (...args: readonly unknown[]) => void;
Defined in: packages/common/src/Console.ts:130
Failures requiring immediate attention.
Inherited from
getEntriesSnapshot
readonly getEntriesSnapshot: () => readonly ConsoleEntry[];
Defined in: packages/common/src/Console.ts:340
Gets all captured entries and clears the internal buffer.
getLevel
readonly getLevel: () => ConsoleLevel;
Defined in: packages/common/src/Console.ts:93
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:104
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:124
Operational milestones (startup, shutdown).
Inherited from
log
readonly log: (...args: readonly unknown[]) => void;
Defined in: packages/common/src/Console.ts:121
General-purpose messages.
Inherited from
name
readonly name: string;
Defined in: packages/common/src/Console.ts:82
Name of this console. Empty for root.
Inherited from
setLevel
readonly setLevel: (level:
| ConsoleLevel
| null) => void;
Defined in: packages/common/src/Console.ts:101
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:136
Displays tabular data. Level: debug.
Inherited from
time
readonly time: (label: string) => void;
Defined in: packages/common/src/Console.ts:139
Starts a timer with the given label. Level: debug.
Inherited from
timeEnd
readonly timeEnd: (label: string) => void;
Defined in: packages/common/src/Console.ts:145
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:142
Logs elapsed time for a timer. Level: debug.
Inherited from
trace
readonly trace: (...args: readonly unknown[]) => void;
Defined in: packages/common/src/Console.ts:115
Outputs a stack trace.
Inherited from
warn
readonly warn: (...args: readonly unknown[]) => void;
Defined in: packages/common/src/Console.ts:127
Recoverable issues that may need attention.
Inherited from
write
readonly write: (entry: ConsoleEntry) => void;
Defined in: packages/common/src/Console.ts:158
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.