Skip to content

Commit

Permalink
add a test for non-overloaded functions
Browse files Browse the repository at this point in the history
  • Loading branch information
smartcontracts committed Jun 2, 2021
1 parent 8008a71 commit ef023b1
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions packages/smock/test/smockit/call-assertions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,24 @@ describe('[smock]: call assertion tests', () => {
mockCaller = await mockCallerFactory.deploy()
})

describe('overloaded functions', () => {
it('should be able to modify both versions of an overloaded function', async () => {
describe('call assertions for functions', () => {
it('should be able to make assertions about a non-overloaded function', async () => {
mock.smocked.getInputtedUint256.will.return.with(0)

const expected1 = ethers.BigNumber.from(1234)
await mockCaller.callMock(
mock.address,
mock.interface.encodeFunctionData('getInputtedUint256(uint256)', [
expected1,
])
)

expect(mock.smocked.getInputtedUint256.calls[0]).to.deep.equal([
expected1,
])
})

it('should be able to make assertions about both versions of an overloaded function', async () => {
mock.smocked['overloadedFunction(uint256)'].will.return.with(0)
mock.smocked['overloadedFunction(uint256,uint256)'].will.return.with(0)

Expand Down

0 comments on commit ef023b1

Please sign in to comment.