UNPKG

orphic-cypress

Version:

Set of utilities and typescript transformers to cover storybook stories with cypress component tests

20 lines (19 loc) 735 B
/** * Turn mockData intended for storybook plugin storybook-addon-mock * into cypress intercepts. Very likely to be used in a beforeEach. * Aliases as the url provided for each mock. Nothing crazy happening * here, you could just write `cy.intercept`s for non-storybook component * tests, or nbd to have ones that are redundant of mockData */ export declare const mockToCyIntercept: (mockData: Array<{ /** url pattern to intercept */ url: string; /** REST method */ method: string; /** Expected status code */ status: number; /** Response to send upon mocked request */ response: unknown; /** Optionally alias intercept as a given name rather than full url */ alias?: string; }>) => void;