Post
Share your knowledge.
How sui move test coverage work ?
When testing your packages on Sui, check you test coverage to see what you missed
While 100% tested code does not guarantee that all conditions and edge cases have been tested correctly, coverage <100% indicates that you may have forgotten to test some cases
Run sui move test --coverage to generate the map
Then sui move coverage summary shows a recap of the proportion of code tested per module
sui move coverage summary --summarize-functions shows a recap of the proportion of code tested per function per module:
sui move coverage source --module <module_name> shows exactly what part of the code is untested per module
finally if you're a move warrior, sui move coverage bytecode --module <module_name> shows exactly what part of the bytecode is untested per module
- Sui
Answers
7Make sure to check your test coverage on Sui before finalizing your packages
Absolutely, test coverage is super important for spotting gaps in your Sui Move tests. The sui move test --coverage command is your best friend here, letting you generate detailed reports to see exactly what you've missed, from module summaries to specific lines of untested code. It's a great way to improve your testing quality.
Do you know the answer?
Please log in and share it.
Sui is a Layer 1 protocol blockchain designed as the first internet-scale programmable blockchain platform.
- How to Maximize Profit Holding SUI: Sui Staking vs Liquid Staking616
- Why does BCS require exact field order for deserialization when Move structs have named fields?65
- Multiple Source Verification Errors" in Sui Move Module Publications - Automated Error Resolution55
- Sui Move Error - Unable to process transaction No valid gas coins found for the transaction419
- Sui Transaction Failing: Objects Reserved for Another Transaction410