You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes it's useful to set tests to be skipped, such as:
When a test is transiently broken
If the current environment does not support running a particular test
Some tests are particularly slow, and would be convenient to only run them when an env variable is set. (Hypothetically, haven't run into these myself yet 😅)
More specific example: I have some end-to-end integration tests that rely on forking a live RPC, but sometimes the test suite is run in offline environments which results in the forking process failing due to lacking an RPC to work with. I'd prefer to catch that scenario, a message like "Skipping fooTest: ETH_RPC_URL not set".
(Bonus points if this is also callable inside setUp())
Would love a skip(string message) function which marks the current test as neither passed nor failed, bails, and prints the message when skipping it.
Additional context
Not sure if this should be part of forge-std, or needs to be part of a vm cheatcode? I suspect some changes would need to be made in forge also?
API Examples:
Rust has the #[ignore] attribute (not sure what the best practice is for skipping at runtime with a message)
@mds1 Good call, I missed #1123, very similar. Bonus points if a message can be optionally included, but can always console.log ahead of it. Closing as dupe.
Component
Forge
Describe the feature you would like
Sometimes it's useful to set tests to be skipped, such as:
More specific example: I have some end-to-end integration tests that rely on forking a live RPC, but sometimes the test suite is run in offline environments which results in the forking process failing due to lacking an RPC to work with. I'd prefer to catch that scenario, a message like "Skipping fooTest: ETH_RPC_URL not set".
(Bonus points if this is also callable inside setUp())
Would love a
skip(string message)
function which marks the current test as neither passed nor failed, bails, and prints the message when skipping it.Additional context
Not sure if this should be part of forge-std, or needs to be part of a vm cheatcode? I suspect some changes would need to be made in forge also?
API Examples:
#[ignore]
attribute (not sure what the best practice is for skipping at runtime with a message)this.skip(...)
and a bunch of other helpers: https://mochajs.org/#inclusive-testsThe text was updated successfully, but these errors were encountered: