Given some contract A
, that depends on another contract B
, what would be the best way to unit test functions from A
without inadvertently testing code from B
.
Normally, we could use stubs to return data that is the same every time, but this is cumbersome to do manually with even a moderate amount of code (generate, compile, and deploy the stub).
Is there a framework or library out there yet that has this sort of functionality built in?
Also would be happy to provide a code example if the description above is too abstract; just comment.
I'm using:
- mochajs with chai assertions
- truffle for a testing framework
- ethereumjs-testrpc for test network