Axinom Mosaic Libraries
    Preparing search index...

    Test function. Returns first mockImplementation result. Throws an error if result is not found. See example:

    const override = vi
    .spyOn(console, 'warn')
    .mockImplementation(log => JSON.parse(`{"prop": '${log}' }`));

    console.warn('test');

    const result = getMockResult<{ prop: string }>(override); //result = { prop: 'test' }
    interface SpyLike<TResult = unknown> {
        mock: { results: { value: TResult }[] };
    }

    Type Parameters

    • TResult = unknown
    Index

    Properties

    Properties

    mock: { results: { value: TResult }[] }