tests.LogEntry
A log line the app or the runtime wrote.
Usage
Inspect messages logged by a component.
// Inspect messages logged by a component.
import { onMount } from 'kuito';
import { assert, render, test, type LogEntry } from 'kuito/tests';
function Legacy() {
onMount(() => console.warn('Legacy is deprecated: use Modern'));
return null;
}
const warnings = (logs: readonly LogEntry[]) => logs.filter((entry) => entry.level === 'warn');
test('mounting Legacy warns once', async () => {
const app = await render(<Legacy />);
assert.equal(warnings(app.logs).length, 1);
assert.match(warnings(app.logs)[0]?.message ?? '', /deprecated/);
});Type declaration
export interface LogEntry {
level: string;
message: string;
}Members 2
| Name | Type | Required | Description |
|---|---|---|---|
level | string | Yes | — |
message | string | Yes | — |
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.