defi-wonderland / smock

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

Cannot mock sibling calls or view calling arguments #109

Closed kevupton closed 2 years ago

kevupton commented 2 years ago

Describe the bug Unable to test methods on the same contract

Reproduction steps


    it('should call a method on the same contract and test it', async () => {

      someContract.check.returns(false);

      const result = await someContract.doCheck(arg1, arg2, arg3);

      expect(result).to.be.false;
      expect(someContract.check).to.have.been.calledWith(arg1, arg2, arg3);
    });

Expected behavior

It should have a function call on check method, with those arguments supplied.

wei3erHase commented 2 years ago

hi @kevupton, as i'd like to see a way of testing internal function calls, so far is not supported and this is the expected behaviour