1
votes

When running a normal test we can use #[should_panic] macro to test fail cases. What is the corresponding alternative for #[tokio::test]

1

1 Answers

2
votes

Just use both:

#[tokio::test]
#[should_panic]
async fn t1() {
    panic!("Nice panic!");
}

Playground