New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
calledOnceWith & calledOnceWithExactly sinon matchers missing #9644
Comments
Yeah, the versions of each packages may be a bit off. I think @sainthkh may have been the last person to really play with the sinon typings, maybe he has some ideas. |
Confirmed the bug. I added them mechanically from the sinon documentation and didn't test them and thought they would naturally work. But I was wrong. Things to do:
|
Can anyone release the next version of |
Oh. Yah, we merged in the PR. Thought it would auto release |
@sainthkh It's been released as 2.9.1 |
The code for this is done in cypress-io/cypress#14371, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior
But TS types define this as allowed:
cypress/cli/types/cypress.d.ts
Line 4264 in c616af4
cypress/cli/types/cypress.d.ts
Line 4276 in c616af4
Desired behavior
Working matcher
Description
I've even started looking into fixing this but this seems to be over my head in a timeframe that I could spend on this right now.
It's not obvious to track what version are you even using because you rely on npm hoisting - your packages define very different versions of
chai
,sinon
,chai-sinon
&@cypress/chai-sinon
. I believe that it would be great to:From what I've analyzed you are actually using your
@cypress/chai-sinon
fork in the Cypress' public API:cypress/packages/driver/src/cy/chai.js
Line 7 in c1daab0
and the driver package requires the v1 of that fork package, but only in its dev dep:
cypress/packages/driver/package.json
Line 16 in c1daab0
so in reality a different version gets probably loaded at runtime in the final product.
At the same time, your fork is already at v2 and it just doesn't really add those methods to the
expect
object. The only ones that are handled are listed here:https://github.com/cypress-io/sinon-chai/blob/3af9baa3b2981db8ade653bcbff58da1a1094a32/lib/sinon-chai.js#L174
Additionally links to the Sinon docs in the JSDOCs above types for all
sinon-chai
method are pointing to Sinon v4 docs but I also don't believe this is actually a version that is used. Note that you link to different methods above those 2 missing methods because they have not been implemented in Sinon v4.Test code to reproduce
Versions
6.1.0
The text was updated successfully, but these errors were encountered: