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

Closed
cm0s opened this issue Apr 17, 2019 · 3 comments · Fixed by #4109
Closed

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

cm0s opened this issue Apr 17, 2019 · 3 comments · Fixed by #4109
Assignees

Comments

@cm0s
Copy link

cm0s 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

@cypress-bot cypress-bot bot added the stage: ready for work The issue is reproducible and in scope label Apr 18, 2019
@flotwig flotwig self-assigned this May 2, 2019
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: ready for work The issue is reproducible and in scope labels May 2, 2019
@cypress-bot cypress-bot bot added stage: work in progress and removed stage: needs review The PR code is done & tested, needs review labels May 2, 2019
@jennifer-shehane
Copy link
Member

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

@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: work in progress labels May 6, 2019
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Jun 28, 2019
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jun 28, 2019

The code for this is done in cypress-io/cypress#4109, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 9, 2019

Released in 3.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants