Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion testing/tests/assertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Assertions"
---

Assertions allow you to declaratively write tests without writing any code.

Check warning on line 5 in testing/tests/assertions.mdx

View check run for this annotation

Mintlify / Mintlify Validation (bruno-a6972042) - vale-spellcheck

testing/tests/assertions.mdx#L5

Did you really mean 'declaratively'?

## Getting Started

Expand All @@ -12,7 +12,7 @@
- **Operator**: The comparison operator
- **Value**: The expected value

![bru assertions](/images/screenshots/get-started/bruno-basics/create_test/bru_test_assert.webp)

Check warning on line 15 in testing/tests/assertions.mdx

View check run for this annotation

Mintlify / Mintlify Validation (bruno-a6972042) - vale-spellcheck

testing/tests/assertions.mdx#L15

Did you really mean 'bru'?

## Common Examples

Expand Down Expand Up @@ -94,7 +94,16 @@
|------------|----------|-------|
| `res.responseTime` | `lt` | `1000` |

## Available Operators
### JSON validation

The `isJson` operator checks whether a value is a valid JSON object or array.

| Expression | Operator | Result |
|------------|----------|--------|
| `res.body` | `isJson` | Passes if the response body is an object (`{}`) or an array (`[]`) |
| `res.body.data` | `isJson` | Passes if `data` is an object or array |

## Available operators

- **Comparison**: `equals`, `notEquals`, `gt`, `gte`, `lt`, `lte`
- **String**: `contains`, `notContains`, `startsWith`, `endsWith`, `matches`, `notMatches`
Expand Down
Loading