defi-wonderland / smock

The Solidity mocking library
MIT License
319 stars 40 forks source link

Error: Invalid Chai property: calledTwice #64

Closed maximebrugel closed 3 years ago

maximebrugel commented 3 years ago

Hello !

Describe the bug

When I run my test with smock :

Error: Invalid Chai property: calledTwice
      at Object.proxyGetter [as get] (node_modules/chai/lib/chai/utils/proxify.js:78:17)
      at Context.<anonymous> (test/unit/OperatorResolver.unit.ts:226:69)

Reproduction steps

Version =>

mixinResolver1 = await smock.fake<TestableMixinResolver>("TestableMixinResolver");

(...)

expect(mixinResolver1.rebuildCache).to.have.been.calledTwice;

Thank you in advance !

smartcontracts commented 3 years ago

Looking into this now!

0xGorilla commented 3 years ago

Did you use the smock chai matchers?

Remember to add at the top of the file:

import { smock } from '@defi-wonderland/smock';
chai.use(smock.matchers);
maximebrugel commented 3 years ago

I forgot the chai.use(smock.matchers) 😇😇😇

Thank you !!!!