In the Waffle documentation here, it shows that revertedWith() can be used with a regular expression. When used I am presented with an error claiming otherwise, already wasted too much time on this one, so I will proceed with the simpler .reverted matcher.

Just hoping someone out there could clear this one up, I can't see where I might have set this up wrong but...

Here is the error, the test was written exactly as the docs show to use it

await expect(token.checkRole('ADMIN')).to.be.revertedWith(/AccessControl: account .* is missing role .*/);

error image


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.