
Basic Test Structure
Common Test Examples
Testing Status Codes
Testing Response Body
Testing Nested Objects
Testing with Conditional Logic
Testing Arrays and Loops
Testing Response Headers
Testing Response Time
Advanced: Saving Values for Next Request
Error Handling
Common Chai Assertions
Bruno-specific assertions
In addition to the standard Chai assertions, Bruno registers custom assertions for working with JSON response bodies.jsonBody
Use jsonBody to validate the response body against a value or to check for the existence of a nested property. This assertion mirrors Postman’s pm.response.to.have.jsonBody(...) API and is convenient for collections imported from Postman.
All variants support negation via
.not (for example, to.not.have.jsonBody("key")).
jsonSchema
Use jsonSchema to validate a response body against a JSON Schema. Bruno uses Ajv under the hood, so any JSON Schema draft supported by Ajv works here. An optional second argument forwards options to the Ajv instance.
Next Steps
For more advanced scripting capabilities, see:- Scripting API - Full API reference
- Response Query - Query complex response data
- Variables - Work with variables across requests