chaijs / sinon-chai

Extends Chai with assertions for the Sinon.JS mocking framework.
Other
1.09k stars 107 forks source link

expect(STUB).to.not.have.been.called works but adding parens explodes #130

Closed mandrewpowers closed 6 years ago

mandrewpowers commented 6 years ago

In my test the following does what I'd expect:

expect(STUB).to.not.have.been.called;

but if I add parens to the end like I normally do I get an exception:

expect(STUB).to.not.have.been.called();
TypeError: expect(...).to.not.have.been.called is not a function
    at Context.it (test/integration/execute.test.js:23:53)
    at <anonymous>

This only occurs when I add .not. to the chain.

domenic commented 6 years ago

Right, per the readme parens are not supported. Not sure why you started doing that. called is indeed not a function.

mandrewpowers commented 6 years ago

The docs do not explicitly state that parens will not work in this case. Also, why are they not supported? Ever other chai call without not* works perfectly fine.

I guess this is just a chai standard I just do not like (didn't pick which framework we used); sorry to bother you.