Crate facet_testhelpers

Crate facet_testhelpers 

Source
Expand description

§facet-testhelpers

codecov crates.io documentation MIT/Apache-2.0 licensed Discord

Lightweight test helpers: a log facade that always does tracing (with colors), and color-backtrace using the btparse backend.

§Usage

Add this to your test files:

#[facet_testhelpers::test]
fn my_test() {
    log::info!("This will be printed with color!");
    // Your test code here
}

The test macro sets up a simple logger that works with both cargo test and cargo nextest run.

§Recommendation

While this crate works with regular cargo test, we recommend using cargo-nextest for:

  • Process-per-test isolation
  • Faster parallel test execution
  • Better test output and reporting

Install with:

cargo install cargo-nextest

Then run tests with:

cargo nextest run

§Sponsors

Thanks to all individual sponsors:

GitHub Sponsors Patreon

…along with corporate sponsors:

AWS Zed Depot

…without whom this work could not exist.

§Special thanks

The facet logo was drawn by Misiasart.

§License

Licensed under either of:

at your option.

Structs§

IPanic
An error type that panics when it’s built (such as when you use ? to coerce to it)

Functions§

setup
Set up a simple logger for tests.

Attribute Macros§

test