Skip to content

Commit

Permalink
misc: Add generic types to net-stubbing for use in intercept and wait (
Browse files Browse the repository at this point in the history
…#29508)

* misc: Add generic types to net-stubbing for use in intercept and wait

* misc: Add changelog entry (#29507)

* misc: Revert to `any` for Interception type of multiple waits (#29507)

The nested types were apparently not supported (as written) before TypeScript ~4.1.Remove them in favour of just using `Interception<any, any>` in this overload of `wait`.

* misc: Move changelog entry (#29507)

---------

Co-authored-by: Cacie Prins <cacieprins@users.noreply.github.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
  • Loading branch information
3 people committed Jun 3, 2024
1 parent 687eb60 commit 4ccdd86
Show file tree
Hide file tree
Showing 4 changed files with 714 additions and 102 deletions.
4 changes: 4 additions & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ _Released 6/4/2024 (PENDING)_
- Fixed a situation where the Launchpad would hang if the project config had not been loaded when the Launchpad first queries the current project. Fixes [#29486](https://github.com/cypress-io/cypress/issues/29486).
- Pre-emptively fix behavior with Chrome for when `unload` events are forcefully deprecated by using `pagehide` as a proxy. Fixes [#29241](https://github.com/cypress-io/cypress/issues/29241).

**Misc:**

- Enhanced the type definitions available to `cy.intercept` and `cy.wait`. The `body` property of both the request and response in an interception can optionally be specified with user-defined types. Addresses [#29507](https://github.com/cypress-io/cypress/issues/29507).

## 13.10.0

_Released 5/21/2024_
Expand Down
2 changes: 1 addition & 1 deletion cli/types/tests/cypress-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ describe('then', () => {

cy.wait(['@foo', '@bar'])
.then(([first, second]) => {
first // $ExpectType Interception
first // $ExpectType Interception<any, any>
})

cy.wait(1234) // $ExpectType Chainable<undefined>
Expand Down
Loading

5 comments on commit 4ccdd86

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 4ccdd86 Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.11.0/linux-x64/develop-4ccdd860ea77b3920009bbc12fa1c41c97522970/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 4ccdd86 Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.11.0/linux-arm64/develop-4ccdd860ea77b3920009bbc12fa1c41c97522970/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 4ccdd86 Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.11.0/win32-x64/develop-4ccdd860ea77b3920009bbc12fa1c41c97522970/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 4ccdd86 Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.11.0/darwin-arm64/develop-4ccdd860ea77b3920009bbc12fa1c41c97522970/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 4ccdd86 Jun 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.11.0/darwin-x64/develop-4ccdd860ea77b3920009bbc12fa1c41c97522970/cypress.tgz

Please sign in to comment.