Skip to content

Add note about accessing http headers in assertions #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 4 additions & 1 deletion docs/testing/assertions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ Assertions allow you to declaratively write tests.
This should cover most of your testing needs. For complex tests, you can write test scripts.

**Example:**
![bru assertions](../public/images/assertions.png)
![bru assertions](../public/images/assertions.png)

## Accessing headers
To access HTTP response headers, you can query `res.headers.['xyz]` (whereas `xyz` is the lower-cased header name like `x-powered-by`for example). Be aware that accessing inexistent headers will result in an error, as an inexistent header is not an empty string, but "undefined".