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

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

    console.warn('test');

    const result = getMockResult<{ prop: string }>(override); //result = { prop: 'test' }

    Type Parameters

    • TResult

    Parameters

    • spyInstance: SpyInstance<any, any, any>

    Returns TResult

Generated using TypeDoc