Expand description
FluentTest: A fluent, Jest-like testing library for Rust
This crate provides a more expressive way to write tests in Rust, inspired by JavaScript testing frameworks like Jest.
By default, assertions behave like standard Rust assertions. Enable enhanced output with:
// In your test code:
use fluent_test::prelude::*;
fn my_test() {
// Enable enhanced output for this test
fluent_test::config().enhanced_output(true).apply();
expect!(2 + 2).to_equal(4);
}
Or set the FLUENT_TEST_ENHANCED_OUTPUT=true environment variable.
Re-exports§
pub use config::initialize;
pub use crate::config::Config;
Modules§
- backend
- Backend module for test evaluation and result generation
- config
- events
- frontend
- Frontend module for rendering test results
- matchers
- Matcher traits module for bringing the traits into scope
- prelude
- Main prelude module containing everything needed for fluent testing
Macros§
- expect
- Main entry point for fluent assertions
- expect_
not - Shorthand for creating a negated expectation This provides a more natural way to write assertions with not
- fluent_
test - Run all FluentTest tests in a module
Structs§
Functions§
- auto_
initialize_ for_ tests - config
- Creates a new test configuration
Attribute Macros§
- after_
all - Registers a function to be run once after all tests in the current module
- before_
all - Registers a function to be run once before any test in the current module
- setup
- Registers a function to be run before each test in the current module
- tear_
down - Registers a function to be run after each test in the current module
- with_
fixtures - Runs a function with setup and teardown fixtures from the current module
- with_
fixtures_ module - Runs all test functions in a module with setup and teardown fixtures