Closed mariogutval closed 2 years ago
@mariogutval have you tried myContract['myFunction(signature)'].returns(true)
, thats how ethersjs
in general works.
This should work as @alejoamiras described. Closing this issue because of inactivity, reopen it if necessary.
Describe the bug Mocking the returned value of a function fails when there is another function with the same name.
Reproduction steps
When you have two different functions like
function myFunction(uint256 x)
andfunction myFunction(uint256 x, address user)
and you want to mock the returned value by usingmyContract.myFunction.returns(true)
, you getTypeError: Cannot read property 'returns' of undefined
Expected behavior It would be great that you could specify the signature of the function (including the arguments) whose returned value you want to mock.
System Specs: