TypeScript API / @laikacms/astro/testing / FakeLoaderContext
Interface: FakeLoaderContext
Properties
collection
ts
collection: string;logger
ts
logger: LoaderLogger;logs
ts
logs: object[];Every log line emitted, tagged by level.
level
ts
level: keyof LoaderLogger;message
ts
message: string;meta
ts
meta: MetaStore;refreshContextData?
ts
optional refreshContextData?: Record<string, unknown>;store
ts
store: DataStore;traffic
ts
traffic: StoreTraffic;Mutations recorded since the last resetTraffic.
Methods
generateDigest()
ts
generateDigest(data): string;Parameters
| Parameter | Type |
|---|---|
data | string | Record<string, unknown> |
Returns
string
parseData()
ts
parseData<TData>(props): Promise<TData>;Type Parameters
| Type Parameter |
|---|
TData extends Record<string, unknown> |
Parameters
| Parameter | Type |
|---|---|
props | { data: TData; id: string; } |
props.data | TData |
props.id | string |
Returns
Promise<TData>
renderMarkdown()
ts
renderMarkdown(content): Promise<{
html: string;
metadata?: Record<string, unknown>;
}>;Parameters
| Parameter | Type |
|---|---|
content | string |
Returns
Promise<{ html: string; metadata?: Record<string, unknown>; }>
resetTraffic()
ts
resetTraffic(): void;Clear traffic — call between two load() runs to isolate the second.
Returns
void
snapshot()
ts
snapshot(): Map<string, DataEntry<Record<string, unknown>>>;The entries currently in the store, keyed by id.
Returns
Map<string, DataEntry<Record<string, unknown>>>