array

Function array 

Source
pub fn array() -> ExpectArray
Expand description

Expects a JSON array. The returned ExpectArray has methods to defined the length, uniqueness, all values meet a condition, etc, that is expected to be returned.

use axum_test::expect_json;

let server = TestServer::new(Router::new())?;

server.get(&"/user/barrington")
    .await
    .assert_json(&json!({
        "name": "Barrington",
        "tags": expect_json::array(),
    }));