Expecting

Crates.io Documentation Crates.io

WARNING: This crate is an alpha release. Test coverage is low, and the API may change without warning.

Expecting provides macros for testing conditions without panicking. The expect_* family of macros cause an early return of [anyhow::Error] if the expected condition is not met.

This crate is especially helpful in async integration tests that involve provisioning and tearing down resources; rather than struggle to catch panics, you can simply use expect_* instead of assert_* to return [Result].

See the docs for usage examples and more info.