Protected StaticgetterNames registered via getter() — used by hasMacro() and flushMacros().
Protected StaticinstancePer-instance properties. Each entry is applied and bound
to this inside the constructor so destructuring stays safe.
Protected StaticmacroNames registered via macro() — used by hasMacro() and flushMacros().
Get response headers.
Get the raw Response object.
Get the response status code.
Assert response status is 400 Bad Request.
Assert response status is 201 Created.
Assert response status is 403 Forbidden.
Assert response has the given header.
Optionalexpected: stringAssert response does not have the given header.
Assert JSON response contains the given data.
Assert JSON response has value at the given path.
Dot-notation path (e.g., 'data.user.id')
Expected value at path
Assert string value at path contains a substring.
Dot-notation path (e.g., 'data.message')
Substring to search for
Assert array length at path equals the expected count.
Dot-notation path (e.g., 'data.items')
Expected array length
Assert a JSON path exists (value can be anything, including null).
Dot-notation path (e.g., 'data.user.id')
Assert array value at path includes a specific item.
Dot-notation path (e.g., 'data.tags')
Item to search for in the array
Assert JSON value at path matches a custom predicate.
Dot-notation path (e.g., 'data.items')
Predicate function to validate the value
Assert a JSON path does not exist.
Dot-notation path (e.g., 'data.user.deletedAt')
Assert multiple JSON paths at once (batch assertion).
Object mapping paths to expected values
Assert JSON response structure matches the given schema.
Assert response status is 204 No Content.
Assert response status is 404 Not Found.
Assert response status is 200 OK.
Assert response status is 500 Internal Server Error.
Assert response has the given status code.
Assert response status is in the 2xx success range.
Assert response status is 401 Unauthorized.
Assert response status is 422 Unprocessable Entity.
Get the response body as text.
StaticflushRemove all macros, instance properties, and getters registered on this class. Does not affect parent classes.
StaticgetterRegister a computed getter on the class prototype.
Register a computed getter on the class prototype.
Property name
Function that computes the value (called with instance as this)
Optionalsingleton: booleanIf true, cache the value after first access
StatichasCheck if a macro, instance property, or getter is registered.
Name to check
StaticinstanceRegister a per-instance property that is bound to this
in the constructor. Safe for destructuring.
When the name matches an existing property, the value type is auto-derived.
Register a per-instance property that is bound to this
in the constructor. Safe for destructuring.
When the name matches an existing property, the value type is auto-derived.
Property name
Function (will be bound) or value
StaticmacroRegister a macro on the class prototype. Can override existing methods.
When the name matches an existing property, the value type is auto-derived.
Register a macro on the class prototype. Can override existing methods.
When the name matches an existing property, the value type is auto-derived.
Method or property name
Function or value to assign
TestResponse
Wrapper around Response with assertion methods.
Example