Skip to content

Commit

Permalink
Added test illustrating header casing issue
Browse files Browse the repository at this point in the history
refs https://github.com/TryGhost/Toolbox/issues/209
refs antongolub/reqresnext#33

- This test should start passing once the upstream dependency (reqresnext) has the referenced issue fixed
  • Loading branch information
naz committed Feb 15, 2022
1 parent d83c20b commit 726f236
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/express-test/test/example-app.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,17 @@ describe('Example App', function () {
assert.equal(headers['x-checked'], 'true');
});

it('check headers, status and body with mixed-case header', async function () {
const {statusCode, headers, body} = await agent
.post('/check/')
.body({foo: 'bar'})
.header('X-Check', true);

assert.equal(statusCode, 200);
assert.deepEqual(body, {foo: 'bar'});
assert.equal(headers['x-checked'], 'true');
});

it('check headers, status and body using set and expect chaining', async function () {
const {body} = await agent
.post('/check/')
Expand Down

0 comments on commit 726f236

Please sign in to comment.