sweet
Very early stage warning! No ongoing maintenance is guaranteed
Basically a jest clone, the sweet crate will set you up with a beautiful test harness and intuitive matchers that are easy on the eyes.
pub use *;
sweet!
Quickstart
- edit
cargo.toml[] = # current version here [[]] = "sweet" = "test/sweet.rs" = false - create file
test/sweet.rspub use *; sweet! - run these commands
Features - Summary
- Pretty Messages
- Success
- In progress
- Failure
- Success
Features - Runner
-
Mutable globals
- When writing lots of tests its helpful to have access to an outer scope
sweet! -
Automatic suite names
- Unless otherwise defined, sweet suites will be named after the files:
//named after file sweet! //custom name sweet! -
Nested Tests
- Sweet is designed to collect and run all tests in one go. All tests exposed in the
sweet.rsfile will be run://test/sub_dir/some_test.rs sweet! //test/sub_dir/mod.rs
- Sweet is designed to collect and run all tests in one go. All tests exposed in the
Example Commands
- Run
cargo test --test sweet
- With watch
cargo watch -q -x 'test --test sweet -- -w'- Clears terminal on each run
- Returns an exit code zero (cleaner output)
- Specify filename
cargo test --test sweet -- my_test


