Im testing wheter a require
function does its job by reverting and want to test in within a truffle test.
it("The URI should be unique", async () =>{
const dupURI = await token.mintUniqueTweetTo(account1, tokenUri1, {from: accounts[0]}); // Mint a new token
expect(dupURI).to.throw();
console.log(dupURI)
});
The thing is that when the require reverts I get the following error:
Error: Transaction: 0xaf416881ff8627e6fe5fe6eaed2512035d7b7e659aeb0638e2f1bd362f380d57 exited with an error (status 0).
Please check that the transaction:
- satisfies all conditions set by Solidity `require` statements.
- does not trigger a Solidity `revert` statement.
And my test does not continue, does anybody have an idea on how to fix this?