Skip to content

"Called on contract" chai matchers don't work #9

Open
@PaulRBerg

Description

@PaulRBerg

Description

As per the waffle docs, we should be able to use the calledOnContract and calledOnContractWith chai matchers:

await token.balanceOf(wallet.address)

expect('balanceOf').to.be.calledOnContract(token);

But they don't work in this project.

How to Reproduce

Modify the "should count up" test like this:

it("should count up", async () => {
  await counter.countUp();
  let count = await counter.getCount();
  expect(count).to.eq(1);
  expect("getCount").to.be.calledOnContract(counter);
});

You will get the following error when running the test:

TypeError: contract.provider must be a MockProvider

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions