Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Rust Testing?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/karthikrshet-rust-testing)
---
name: rust-testing
description: "Write and fix tests in Rust: unit tests in #[cfg(test)] modules, integration tests in tests/, mocking at boundaries, async tests and CI settings."
tags: [rust, testing]
---
# Rust Testing
## When to use
- Writing or reviewing Rust tests
- Setting up a test suite
- Fixing slow or flaky tests
## Procedure
1. Unit tests in #[cfg(test)] modules, integration tests in tests/
2. Use proptest for invariants
3. Test async code with #[tokio::test]
4. Use insta for snapshot tests of complex output
5. Run cargo test and cargo nextest in CI
## Checklist
- [ ] Doc tests compile
- [ ] No unwrap in test helpers that hides context
## Anti-patterns
- Over-mocking traits
- Ignoring flaky tests with #[ignore] forever