You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue recently with sinon-chai caused by the design choice to make some of its chai matchers implemented as non--function properties.
If you perform an expectation like:
expect(spy).to.have.been.calledOnce;
that expectation will not fail if the test code fails to configure chai to support sinon-chain matchers, and will instead simply be quietly ignored.
On the other hand, if sinon-chai implemented such matchers using a function call syntax, as in:
expect(spy).to.have.been.calledOnce();
then forgetting to do chai.use(require('sinon-chai')) would not cause tests to be quietly ignored and would instead cause them to report an error complaining about undefined not being a callable.
The text was updated successfully, but these errors were encountered:
I encountered an issue recently with
sinon-chai
caused by the design choice to make some of itschai
matchers implemented as non--function properties.If you perform an expectation like:
that expectation will not fail if the test code fails to configure
chai
to supportsinon-chain
matchers, and will instead simply be quietly ignored.On the other hand, if
sinon-chai
implemented such matchers using a function call syntax, as in:then forgetting to do
chai.use(require('sinon-chai'))
would not cause tests to be quietly ignored and would instead cause them to report an error complaining aboutundefined
not being a callable.The text was updated successfully, but these errors were encountered: