From 34e5cb11e257a4b344b7c20f70fb0fa23629e34a Mon Sep 17 00:00:00 2001 From: Mario Rimann Date: Fri, 6 Oct 2023 14:46:31 +0200 Subject: [PATCH] Add note about accessing http headers in assertions See #13 --- docs/testing/assertions.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/testing/assertions.md b/docs/testing/assertions.md index 5703cf44..2d272240 100644 --- a/docs/testing/assertions.md +++ b/docs/testing/assertions.md @@ -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) \ No newline at end of file +![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".