Skip to content

Commit 8e3ff03

Browse files
authored
Fix typescript signature (#478)
* chore: update to Node.js 20 * fix: fix waitUntil chained value type BREAKING CHANGE: TypeScript tests could now throw because of operations made on the value returned by `checkFunction` (passed to cy.waitUntil). The type was previously `undefined` while now reflecting the type returned by `checkFunction`. fix #477
1 parent 526da32 commit 8e3ff03

File tree

5 files changed

+14
-2
lines changed

5 files changed

+14
-2
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: node_js
22
node_js:
3-
- 10
3+
- 20
44
addons:
55
apt:
66
packages:

cypress/types/plugin.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,7 @@ cy.wrap('').waitUntil((subject) => subject.length)
8282
cy.wrap('').waitUntil<boolean>((subject) => !!subject.length)
8383
cy.wrap<string>('').waitUntil<boolean>((subject) => !!subject.length)
8484
cy.wrap<string>('').waitUntil((subject) => subject.length)
85+
86+
cy.waitUntil(() => cy.task<number>('myTaskReturningANumber')).then((subject) => {
87+
subject * subject
88+
})

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ declare namespace Cypress {
2626
subject: Subject | undefined
2727
) => ReturnType | Chainable<ReturnType> | Promise<ReturnType>,
2828
options?: WaitUntilOptions<Subject>
29-
): Chainable<Subject>
29+
): Chainable<ReturnType>
3030
}
3131
}

package-lock.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"name": "cypress-wait-until",
33
"version": "2.0.1",
4+
"engines" : {
5+
"npm" : ">=9.6.4",
6+
"node" : ">=20.1.0"
7+
},
48
"description": "A waiting plugin for Cypress",
59
"main": "src/index.js",
610
"dependencies": {},

0 commit comments

Comments
 (0)