I am testing my contract using Waffle and I am following the documentation provided, using const provider = new MockProvider();
to get a provider for testing.
An error was raised in expect().catch()
and it says that "Provider not found". Before trying to catch it, I had a more annoying warning that told me to handle errors and this is what I get after handling them.
Everything seems to work as expected but I would like to get rid of this stuff.
I let my code bellow
it("Shall fund the contract", async () =>
{
const contract = await deployContract()
const address = "0x5FbDB2315678afecb367f032d93F642f64180aa3";
const provider = new MockProvider();
const [wallet, otherWallet] = provider.getWallets();
tx = {
to: address,
value: utils.parseEther("3.0")
}
await wallet.signTransaction(tx);
const walletTo = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266";
expect(await wallet.sendTransaction(tx)).to.changeEtherBalance(walletTo, 3)
.then()
.catch((err) =>
{
//console.log(err)
});
})