From 02cf90fe0819cc76031061a6500dfd20255863c2 Mon Sep 17 00:00:00 2001 From: Harald Reingruber Date: Sun, 4 Dec 2022 22:19:14 +0100 Subject: [PATCH] Docs: Add wasm-pack test example for single test The name-matching example for selecting tests didn't work for me. Maybe something changed in wasm-pack or cargo test? However, specifying the full module+test name worked, like described in the cargo test docs: https://doc.rust-lang.org/cargo/commands/cargo-test.html --- docs/src/commands/test.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/src/commands/test.md b/docs/src/commands/test.md index b851b0ab..5f382c8e 100644 --- a/docs/src/commands/test.md +++ b/docs/src/commands/test.md @@ -74,9 +74,12 @@ $ tree crates/foo # Run all tests in tests/diff_patch.rs in Firefox wasm-pack test crates/foo --firefox --headless --test diff_patch -# Run all tests in tests/diff_patch.rs that contain the word "replace" +# Run all tests in tests/diff_patch.rs that contain the word "replace" (does that still work?) wasm-pack test crates/foo --firefox --headless --test diff_patch replace +# Run single test in tests/diff_patch.rs +wasm-pack test crates/foo --firefox --headless --test diff_patch -- modname::test_name + # Run all tests inside of a `tests` module inside of src/lib/diff.rs wasm-pack test crates/foo --firefox --headless --lib diff::tests