Expand description
Helpers for testing the web server and services.
When writing tests, keep the following points in mind:
- In every test, call
setup. This will set up the logger so that all console output is captured by the test runner. All logs emitted withrelay_logwill show up for test failures or when run with--nocapture.
§Example
#[test]
fn my_test() {
relay_test::setup();
relay_log::debug!("hello, world!");
}Functions§
- mock_
service - Spawns a mock service that handles messages through a closure.
- setup
- Setup the test environment.