I want to simulate revert-error, launching tests of Solidity contract with Truffle, but I need to get input call data for simulating it in other project, which I got from debugger. How can I launch debug despite errors?
Asked
Active
Viewed 310 times
1 Answers
0
You can use revertedWith to simulate revert-error, in my case I revert if the user don't have enough tokens.
it("Transfer token", async ()=> {
await expect(instance.transfer.call(accounts[1],9999999999)).to.be.revertedWith("You dont have enough tokens")
});

Spandan Joshi
- 809
- 10
- 11