From 68a19a76b7c232d1e3dd4e080b4442133609dec1 Mon Sep 17 00:00:00 2001 From: Martin Jakubik Date: Wed, 29 Nov 2017 14:13:23 +0100 Subject: [PATCH] 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. --- types/cypress/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/cypress/index.d.ts b/types/cypress/index.d.ts index f76aad4afb..1ffb365418 100644 --- a/types/cypress/index.d.ts +++ b/types/cypress/index.d.ts @@ -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