Skip to content

Commit 4ccdd86

Browse files
scottmcginnesscacieprinsjennifer-shehane
authored
misc: Add generic types to net-stubbing for use in intercept and wait (#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>
1 parent 687eb60 commit 4ccdd86

4 files changed

Lines changed: 714 additions & 102 deletions

File tree

cli/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ _Released 6/4/2024 (PENDING)_
1616
- 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).
1717
- 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).
1818

19+
**Misc:**
20+
21+
- 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).
22+
1923
## 13.10.0
2024

2125
_Released 5/21/2024_

cli/types/tests/cypress-tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ describe('then', () => {
513513

514514
cy.wait(['@foo', '@bar'])
515515
.then(([first, second]) => {
516-
first // $ExpectType Interception
516+
first // $ExpectType Interception<any, any>
517517
})
518518

519519
cy.wait(1234) // $ExpectType Chainable<undefined>

0 commit comments

Comments
 (0)