ethereum-optimism / smock

[Optimism] Solidity mock contracts in JavaScript
73 stars 15 forks source link

TypeError when reading an empty calls array #42

Closed maurelian closed 3 years ago

maurelian commented 3 years ago

I wanted to test that under a certain condition, no call is made to a contract. Using smock I would do something like:

expect(Mock__OVM_L2ToL1MessagePasser.smocked.sendMessage.calls.length).to.deep.equal(0)

That results in the same error in the above description (TypeError: Cannot read property 'map' of undefined). If it helps for context, here is what I wrote instead.