Rust Testing
TDD in Rust: unit, integration, async, and property-based tests with mockall, proptest, and coverage.
- What
- TDD in Rust: unit, integration, async, and property-based tests with mockall, proptest, and coverage.
- Cost
- Free
- Needs
- Use "Rust Testing" with your Muse.
- Install
- Copy the installer prompt below into your Muse — your agent does the rest.
Curated by Skill Harbor: a comprehensive TDD workflow for Rust, from the red-green-refactor cycle down to concrete tooling. Covers unit tests in #[cfg(test)] modules, integration tests under tests/ (each file its own test binary), async tests with tokio (including timeout handling), parameterized tests and fixtures with rstest, property-based testing with proptest (roundtrip properties, custom strategies like generated emails), trait mocking with mockall, executable doc tests, Criterion benchmarks with HTML reports, and coverage with cargo-llvm-cov (sensible targets: 100% for critical business logic, 90%+ for public API, 80%+ general, with a --fail-under-lines gate). Includes a GitHub Actions CI template (fmt check, clippy with denied warnings, test run, coverage gate) and a best-practices list: test behavior not implementation, prefer assert_eq! for better messages, keep tests independent with no shared mutable state, fix flaky tests instead of ignoring them, never sleep() in tests. By @affaan-m, listed here with credit to its creator. From the affaan-m/ECC repository (MIT). Honest caveats: pure guidance, nothing to install; assumes a Rust toolchain (cargo) with the above crates as dev-dependencies. Skill Harbor never reviews the code, review it yourself before use.
Version:
Install
Copy the install package below, then paste it into MuseWe automatically scan every listing and flag anything suspicious, but we can't review every line of community code. Here's how to check a build yourself before you install it.
Use "Rust Testing" with your Muse. Prerequisites: the Muse app (mobile or web). Pure guidance skill, nothing to install. A Rust project with cargo available (the skill references rstest, proptest, mockall, cargo-llvm-cov, and criterion as dev-dependencies). 1. Open the skill: https://github.com/affaan-m/ECC/blob/main/skills/rust-testing/SKILL.md and copy the full SKILL.md text. 2. Paste it into a chat with Muse and add: "Write tests for [this function / module] following the TDD workflow: [paste your code]." 3. Ask Muse to start RED (failing test first), then implement the minimal GREEN code, then refactor while keeping tests green. Tip: ask for property-based tests on your input validation and parsers. They find the edge cases you would never think to write by hand. Safety: a skill is plain-text instructions; it runs nothing by itself. Review any code before committing it, never paste secrets into a chat, and review anything Muse proposes before it acts.
Saved to your recent installs. Find it anytime on /connect.
Questions
How do I install a build?
Every product page includes a copy-paste install prompt. Paste it into your Muse and it sets the build up for you — no manual configuration.
Where does my money go?
Straight to the seller. Skill Harbor never processes payments: checkout happens on the seller’s own page, usually Stripe.
What does the ✓ next to a creator’s name mean?
It means we confirmed the identity of the person behind the listing. It says nothing about the code itself — always check a build before installing it.