- Home
- Skills
- Raintree Technology
- Claude Starter
- Move Testing
move-testing_skill
62
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill raintree-technology/claude-starter --skill move-testing- SKILL.md4.2 KB
Overview
This skill is an expert guide for testing Move smart contracts on Aptos, covering unit and integration tests, Move Prover formal verification, debugging strategies, coverage goals, and CI/CD integration. It provides practical patterns, commands, and troubleshooting tips to build reliable, production-ready Move modules. The content targets developers who need structured testing workflows and automated verification in their Aptos projects.
How this skill works
The skill explains what to inspect in tests: resource existence, state transitions, access control, abort conditions, and edge cases. It shows concrete Move test attributes, multi-signer patterns, expected-failure tests, test-only helpers, debug printing, and how to run tests, coverage, gas profiling, and the Move Prover. It also outlines CI steps to automate tests and prover runs in pipelines.
When to use it
- When writing unit tests for Move modules that create, borrow, or move resources.
- When testing multi-signer flows such as transfers or multi-party initialization.
- When verifying abort conditions and specific error codes with expected_failure tests.
- When you need formal verification of invariants and pre/post conditions with Move Prover.
- When adding automated test runs and prover checks to CI/CD pipelines.
Best practices
- Cover all public functions, abort paths, access controls, and state transitions.
- Write small, focused tests and use test-only helpers for setup and reuse.
- Use #[expected_failure(abort_code = ...)] for precise error assertions.
- Profile gas in tests and keep test loops short to avoid timeouts.
- Run aptos move prove for critical modules and include it in CI.
Example use cases
- Unit test for resource creation: assert exists and validate fields after create_resource.
- Multi-signer transfer test: initialize both signers, execute transfer, assert balances.
- Error path test: assert transfer aborts with insufficient balance using expected_failure.
- Gas and coverage check: run aptos move test --gas --coverage to profile and measure coverage.
- CI workflow: run aptos move test --coverage and aptos move prove in a GitHub Actions job.
FAQ
Use the #[test(account = @0x1)] attribute to inject a signer parameter into the test function.
When should I use Move Prover versus unit tests?
Use unit tests for behavior and edge cases; use Move Prover to verify invariants, pre/post conditions, and absence of specified aborts for critical logic.