mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-04 22:10:40 -05:00
add Cypress.sinon type (#6725)
This commit is contained in:
Vendored
+9
@@ -207,6 +207,15 @@ declare namespace Cypress {
|
||||
* new Cypress.Promise((resolve, reject) => { ... })
|
||||
*/
|
||||
Promise: Bluebird.BluebirdStatic
|
||||
/**
|
||||
* Cypress includes Sinon.js library used in `cy.spy` and `cy.stub`.
|
||||
*
|
||||
* @see https://sinonjs.org/
|
||||
* @see https://on.cypress.io/stubs-spies-and-clocks
|
||||
* @see https://example.cypress.io/commands/spies-stubs-clocks
|
||||
*/
|
||||
sinon: sinon.SinonApi
|
||||
|
||||
/**
|
||||
* Cypress version string. i.e. "1.1.2"
|
||||
* @see https://on.cypress.io/version
|
||||
|
||||
@@ -13,6 +13,13 @@ namespace CypressMomentTests {
|
||||
Cypress.moment().startOf('week') // $ExpectType Moment
|
||||
}
|
||||
|
||||
namespace CypressSinonTests {
|
||||
Cypress.sinon // $ExpectType SinonApi
|
||||
const stub = cy.stub()
|
||||
stub(2, 'foo')
|
||||
expect(stub).to.have.been.calledWith(Cypress.sinon.match.number, Cypress.sinon.match('foo'))
|
||||
}
|
||||
|
||||
namespace CypressJqueryTests {
|
||||
Cypress.$ // $ExpectType JQueryStatic
|
||||
Cypress.$('selector') // $ExpectType JQuery<HTMLElement>
|
||||
|
||||
Reference in New Issue
Block a user