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.
edit cargo.toml
```toml
[dev-dependencies]
sweet = # current version here
[[test]] name = "sweet" path = "test/sweet.rs" harness = false ```
create file test/sweet.rs
```rust
pub use sweet::*;
sweet! { it "works" { expect(true).tobefalse()?; } } ```
sh
rustup default nightly
cargo test --test sweet
Nested Tests
Sweet is designed to collect and run all tests in one go. All tests exposed in the sweet.rs
file will be run:
```rust //test/subdir/sometest.rs sweet!{ it "works" { expect(true).tobetrue(); } } //test/subdir/mod.rs mod sometest //test/sweet.rs
pub use sweet::*; mod sub_dir; ```
cargo test --test sweet
cargo watch -q -x 'test --test sweet -- -w'
cargo test --test sweet -- my_test