Skip to content

Instantly share code, notes, and snippets.

@kevinold
Created March 16, 2020 19:36
Show Gist options
  • Save kevinold/a4e7626e10c3441a2e5eb88a3deac564 to your computer and use it in GitHub Desktop.
Save kevinold/a4e7626e10c3441a2e5eb88a3deac564 to your computer and use it in GitHub Desktop.
flexRoute plugin idea
const internalFlexRoute = curry((httpVerb: string, route: string) => {
return cy.route(httpVerb, route);
});
const flexRoute = curry((httpVerb: string, route: string, response: object) => {
const route = internalFlexroute(httpVerb, route);
return route(response);
});
beforeEach(() => {
flexRoute("POST", "/transactions", {});
//flexRoute({ abc: 123 });
});
flexRoute({ abc: 123 });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment