Crate relay_test

source
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 with relay_log will show up for test failures or when run with --nocapture.

§Example

#[test]
fn my_test() {
    relay_test::setup();

    relay_log::debug!("hello, world!");
}

Functions§

  • Spawns a mock service that handles messages through a closure.
  • Setup the test environment.