-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Snapshot Testing #260
Snapshot Testing #260
Conversation
packages/cw-orch-mock/src/snapshots/cw_orch_mock__core__snapshot_testing.snap
Outdated
Show resolved
Hide resolved
Codecov Report
Additional details and impacted files
|
This is great! I never knew that I wanted snapshot testing in cosmwasm but it seems like the perfect fit :) |
Today, the take_storage_snapshot function is a member of the Mock and thus the snapshots have to be named to be recognized from one another. |
It's good that it needs a name but in the code it doesn't? See my comment above. |
Oh yeah I have added a name after you suggested it |
…rchestrator into update/snapshot-testing
Status on this? Really want Abstract snapshots for our next release! |
This PR aims at introducing snapshot testing for migrations of smart-contracts. This is used to make sure that no breaking change to underlying state is introduced my version modifications :
Implementation
We introduce a new
snapshot_testing
method on theMock
structure. We advise using it at the end of every test that need stabilizing. It dumps the whole contract states of your structures and snapshot tests it.You can test it by:
counter.increment()?;
in thepackages/cw-orch-mock/tests/conditional.rs
filecargo test
More information about snapshot testing here
https://insta.rs/docs/quickstart/