chaijs / sinon-chai

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

How to use .notCalled with expect? #154

Closed Splinteer closed 2 years ago

Splinteer commented 2 years ago

Hello, I try to use the .notCalled with expect but everytime I try to add the chai .not, it tells me that this is not a function.

Here is what I tried:

  expect(createCompany).not.to.have.been.called();
  expect(createCompany).to.not.have.been.called();
  expect(createCompany).to.have.not.been.called();
  expect(createCompany).to.have.been.not.called();
  expect(createCompany).to.have.been.notCalled();
  expect(createCompany).not.called();
Splinteer commented 2 years ago

Ok so I found that this is because of the parens. So just replace called() by called and it's working.