Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cy.server options not documented and not available in typescript definition file #3992

Open
cm0s opened this issue Apr 17, 2019 · 1 comment

Comments

3 participants
@cm0s
Copy link

commented Apr 17, 2019

Current behavior:

cy.server command has a really useful option onAnyRequest. Which is really practical to inject headers or do other stuff.

Here is blog post describing how it can be used : https://medium.com/agilix/cypress-testing-include-custom-http-header-on-each-http-request-2b3693813e97

This option and apparently a few other ones are not documented and are also not available in the Typescript definition (cli/types/index.d.ts) (so cannot be used when using Typescript).

Desired behavior:

Having at least the Typescript definition updated, and if possible a line in the documentation about this option.

Steps to reproduce: (app code and test code)

 cy.server({
      onAnyRequest: function (route, proxy) {
         //...
      }
  });

This will not work when using typescript, it works with js.

Versions

Cypress 3.2.0

@jennifer-shehane

This comment has been minimized.

Copy link
Member

commented May 3, 2019

We've added this as well as onAnyAbort and onAnyResponse to our documentation in this PR - cypress-io/cypress-documentation#1652

The TypeScript defs still are in progress of being written here: #4109

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.