Skip to content

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 ​

ParameterType
datastring | Record<string, unknown>

Returns ​

string


parseData() ​

ts
parseData<TData>(props): Promise<TData>;

Type Parameters ​

Type Parameter
TData extends Record<string, unknown>

Parameters ​

ParameterType
props{ data: TData; id: string; }
props.dataTData
props.idstring

Returns ​

Promise<TData>


renderMarkdown() ​

ts
renderMarkdown(content): Promise<{
  html: string;
  metadata?: Record<string, unknown>;
}>;

Parameters ​

ParameterType
contentstring

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>>>

Released under the MIT License.