feat(cheatcodes
): show detailed reverts regardless of verbosity level defined
#928
Labels
A-cheatcodes
Area: cheatcodes
C-forge
Command: forge
Cmd-forge-test
Command: forge test
P-high
Priority: high
T-feature
Type: feature
Currently when a cheatcode reverts a single-line reason is provided. This works great for some cheatcodes, but for others, this might prove to be pretty cluttered if we want to provide detailed explanations of why the cheatcode reverted.
Having a mechanism by which we can provide more detailed cheatcode reverts will allow us to:
expectEmit
revertedThese are technically possible today, but it would result in a very long single line revert message which would be hard to read.
I propose that we always display logs for failed tests. Currently they are hidden behind some level of verbosity, but we only ever print
console.log
and DSTest-style logs. The truth is that these are usually only emitted when you are debugging or an assertion fails. In the first case, they are probably temporarily added to debug an issue, in which case, the test is probably failing. In the second case, the test is failing, and you probably want them to show up.If we do this, then cheatcodes could inject fake logs for longer-form revert explanations.
The text was updated successfully, but these errors were encountered: