Cargo owns the native path.
cargo add vanilla-test
cargo testNative Cargo provides full libtest output, doctests, typed lifecycle errors, formatting checks, and package verification.
Rust · native + browser WebAssembly
Use the zero-dependency native crate with Cargo, then compile the exact same Rust unit tests into a safe browser WebAssembly harness. No JavaScript test copy, wasm framework, generated glue, or unsafe block is required; the optional benchmark uses one scoped linkage-only export attribute.
cargo add vanilla-test
cargo testNative Cargo provides full libtest output, doctests, typed lifecycle errors, formatting checks, and package verification.
rustup target add wasm32-unknown-unknown
cargo install vanilla-test --version 2.1.0
cargo vanilla-test --browserThe dependency-free Cargo subcommand emits a deployable example with passive rendered-text, fetch, MIME, instantiation, and export checks. It then calls the same Rust library harness once and treats zero as passed. Every result appears on-page and in DevTools. Add --page tests/browser.html to inspect already-rendered text from a compatible page beside that harness.
Contract
One active test, exact unique descriptions, first decision wins, undecided completion fails, and reporting seals the suite. Rust uses ordinary results and its type system instead of copying JavaScript-only runtime behavior.
Install, run native tests, build browser WebAssembly, add passive rendered-text checks, and deploy the output.
Open the Rust guide →Complete native suites, typed-error handling, browser commands, and a passive-text page.
Open Rust examples →Public types, methods, result fields, lifecycle errors, and a complete program.
Open the Rust API →Review native region, executable-line, and function evidence without conflating browser compatibility.
Open Rust coverage →Browse the public types and method documentation for the published crate.
Open docs.rs →CI tests the native library and browser-build CLI, then runs the same library suite as WebAssembly in Chrome.
Review Rust testing →The exact minimal target is wasm32-unknown-unknown. This repository's module has zero host imports, so Rust cannot call JavaScript functions, the DOM, the console, or other browser APIs. The tiny host adapter performs passive page and delivery checks, then runs the same seven Rust #[test] functions—including the Behavioral consumer journey—through aggregate libtest status. Native Cargo prints individual Rust names and diagnostics; a WASM panic traps the browser run, and OS- or thread-dependent tests remain native-only.