fix(types): use SinonStatic for Cypress.sinon type (#7398)

This commit is contained in:
Zach Bloomquist
2020-05-18 14:31:45 -04:00
committed by GitHub
parent e5e2afc421
commit a854089c77
2 changed files with 7 additions and 2 deletions

View File

@@ -222,7 +222,7 @@ declare namespace Cypress {
* @see https://on.cypress.io/stubs-spies-and-clocks
* @see https://example.cypress.io/commands/spies-stubs-clocks
*/
sinon: sinon.SinonApi
sinon: sinon.SinonStatic
/**
* Cypress version string. i.e. "1.1.2"

View File

@@ -14,10 +14,15 @@ namespace CypressMomentTests {
}
namespace CypressSinonTests {
Cypress.sinon // $ExpectType SinonApi
Cypress.sinon // $ExpectType SinonStatic
const stub = cy.stub()
stub(2, 'foo')
expect(stub).to.have.been.calledWith(Cypress.sinon.match.number, Cypress.sinon.match('foo'))
const stub2 = Cypress.sinon.stub()
stub2(2, 'foo')
expect(stub2).to.have.been.calledWith(Cypress.sinon.match.number, Cypress.sinon.match('foo'))
}
namespace CypressJqueryTests {