@hankei6km/jest-mock-nuxt-content
Version:
nuxt-content mock for jest
18 lines (17 loc) • 655 B
TypeScript
/// <reference types="jest" />
declare type MockFn = jest.Mock<any, any>;
declare const MockNamesValues: readonly ["only", "without", "where", "sortBy", "limit", "skip", "search", "surround"];
declare type MockNames = typeof MockNamesValues[number];
declare type ChainItem = MockFn;
declare type ChainList = {
count: () => number;
at: (idx: number) => ChainItem;
find: (name: MockNames) => ChainItem;
findAll: (name: MockNames) => ChainList;
};
export default function mockContent(): {
$content: jest.Mock<any, any>;
mockResponse: (res: any) => Promise<ChainList>;
mockError: (reason: any) => Promise<ChainList>;
};
export {};