nomoixyz / vulcan

Development framework for Foundry projects
https://nomoixyz.github.io/vulcan/
MIT License
286 stars 18 forks source link

Adding custom error messages to Except utils #229

Closed mortimr closed 10 months ago

mortimr commented 10 months ago

Hi !

I've been transitioning a test suite to vulcan and the only feature that I'm missing from the forge-std Test contract is the ability to specify a custom error message. Ex:

assertEq(a, b, "a is not equal to b");

which was a really really nice feature as it really helped identify the exact failing condition

I was wondering if you would be open to extending the Expect utility to also have this feature with something like

expect(a).toEqual(b, "a is not equal to b")

Or something more exotic

because("a should be equal to b").expect(a).toEqual(b);

I could help implementing this, just lmk if it's something you think would fit in this library !

gnkz commented 10 months ago

Merged: #231