mgattozzi/assay

Struggling with test output

felipesere opened this issue · 1 comments

I have a test that roughly boils down to

#[assay]
async fn successfully_trigger_for_ci_job() {
    // Arrange
    let context = TestContext::start().await;

   ... a bunch of things...

    let status = response.status();
    let body = response
        .text()
        .await
        .unwrap();

    assay::assert_eq!(BodyAndStatus { body, status}, BodyAndStatus { body: "".to_string(), status: StatusCode::OK })
}

If I "break" the test by replacing the expected body, then the test output is just

Screenshot 2022-06-10 at 09 38 59

where I'd expect to get a nice error based on pretty_assertions.

I don't see any feature flags or anything that I may have forgotten?
Are there any constraints on how to use assay to get the pretty errors?

Hey @felipesere I haven't picked up this project in a while, but you didn't do anything wrong with how you used assay. This was a failure on my end.The output from the spawned subprocess was not included in the panic, it's using the panic from the assay macro. This is now fixed in 0313859 and includes tests to avoid this happening in the future