Open onbjerg opened 2 years ago
See also a thought I had for the behavioural tests for the test runners that might be better: https://github.com/onbjerg/foundry-test (the repo is a test suite I'm building up while migrating to REVM)
Supportive of the idea, no strong opinions on the form factor
This issue is to discuss the possibility of using snapshot testing in various capacities.
Places I think it will definitely make sense to use snapshot tests:
forge fmt
tests since it takes some text and transforms it. Updating the tests for a full-fledged formatting run can end up being a pain.forge flatten
tests. Same reasoning as above.Additionally, it might make sense to use snapshot tests for a larger Solidity test suite. Currently we have
testdata
directories in multiple crates, some with duplicate tests, and some that are entirely unused. Some crates refer directly toevm-adapters/testdata
instead.I propose we create a top-level directory with various tests inside. Each test would be in its own folder and could either be a full project (for CLI integration tests) or single files (for behavioural tests).
There are also some obvious drawbacks to snapshot tests however that we must keep in mind:
What are your thoughts?
Snapshot test library for Rust: https://crates.io/crates/insta