Crates.io | test-collector-derive |
lib.rs | test-collector-derive |
version | 0.1.2 |
source | src |
created_at | 2022-05-28 22:18:31.972698 |
updated_at | 2022-06-17 18:34:28.433697 |
description | A derive to be able to mark the tests method, so you can iterate over them |
homepage | |
repository | https://github.com/MIF-0/test-collector/tree/main/test-collector-derive |
max_upload_size | |
id | 596049 |
size | 7,034 |
test-collector-derive will give you '#[collect_test]' which you can use to collect the tests
this lib using inventory
.
Supposed to be used together with test-collector
, but you can use it by its own.
#[collect_test]
#[test]
pub fn sync_test_success() {
println!("Executed sync!");
assert_eq!(true, true);
}
#[collect_test(async)]
#[actix_web::test]
pub async fn async_test_success() {
let client = reqwest::Client::builder()
.build()
.expect("error during client build");
let response = client.get("http://localhost:9090/").send().await;
assert!(response.is_ok());
}