// Checks if response body exactly matches expected value.
rq.response.to.have.body(expectedValue: string)
// Checks response status code or text.
rq.response.to.have.status(expectedValue: number | string)
rq.response.to.have.status(200);
rq.response.to.have.status("OK");
// Checks if response has specified header (case-insensitive)
rq.response.to.have.header(headerName: string)
// Validates that response body is valid JSON.
rq.response.to.have.jsonBody();
// Checks if a path exists in the response.
rq.response.to.have.jsonBody(path: string)
rq.response.to.have.jsonBody("user.name");
// Checks if a JSON path has a specific value.
rq.response.to.have.jsonBody(path: string, value: any)
rq.response.to.have.jsonBody("user.name", "John");
// Validates the response body against a JSON schema. Accepts optional Ajv configuration.
rq.response.to.have.jsonSchema(schema: object, ajvOptions?: AjvOptions)
rq.response.to.have.jsonSchema({
type: "object",
required: ["id", "name"],
properties: {
id: { type: "number" },
name: { type: "string" },
email: { type: "string", format: "email" }
}
}, { allErrors: true });