Skip to content

Commit 4da73dd

Browse files
stefanjudissorccu
andauthored
fix: update UrlAssertionBuilder docs (#1341)
* fix: update UrlAssertionBuilder docs * Update site/content/docs/cli/constructs-reference.md Co-authored-by: Simo Kinnunen <[email protected]> --------- Co-authored-by: Simo Kinnunen <[email protected]>
1 parent 9948159 commit 4da73dd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

site/content/docs/cli/constructs-reference.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,17 @@ The `request` object is a mandatory part of an URL monitor.
326326
- `skipSSL`: A boolean indicating whether to skip validation of SSL certificates.
327327
- `assertions`: You can define assertions via the `UrlAssertionBuilder`. For URL monitors, only status code assertions are supported. For example:
328328

329+
### `UrlAssertionBuilder`
330+
331+
To define `assertions` for the `request` of an `UrlMonitor` you should use the `UrlAssertionBuilder`. The `UrlAssertionBuilder`
332+
has the following properties:
333+
334+
- `statusCode()`: Assert the HTTP status code for the HTTP response, e.g. `200` or `201`.
335+
336+
Here is an example:
337+
338+
- Assert the status code of a HTTP request
339+
329340
```ts
330341
UrlAssertionBuilder.statusCode().equals(200)
331342
// renders to a JSON string

0 commit comments

Comments
 (0)