Add missing RegExp definition and fix route

Add the missing RegExp definition for the url params of the route function. Also allow to call the route with the options params.
This commit is contained in:
Martin Jakubik
2017-11-29 14:13:23 +01:00
parent 779a35bfdb
commit 68a19a76b7

View File

@@ -318,9 +318,9 @@ declare namespace Cypress {
/**
* @see https://on.cypress.io/api/route
*/
route(url: string, response?: any): Chainable;
route(method: string, url: string, response?: any): Chainable;
route(fn: () => RouteOptions | RouteOptions): Chainable;
route(url: string | RegExp, response?: any): Chainable;
route(method: string, url: string | RegExp, response?: any): Chainable;
route(fn: (() => RouteOptions) | RouteOptions): Chainable;
/**
* @see https://on.cypress.io/api/screenshot