test

Attribute Macro test 

Source
#[test]
Expand description

An attribute macro that defines an async test function for a Cot-powered app.

This is pretty much an equivalent to #[tokio::test] provided so that you don’t have to declare tokio as a dependency in your tests.

§Examples

use cot::test::TestDatabase;

#[cot::test]
async fn test_db() {
    let db = TestDatabase::new_sqlite().await.unwrap();
    // do something with the database
    db.cleanup().await.unwrap();
}