Skip to content

Commit

Permalink
chore: add assertion for custom headers
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeed committed Jan 30, 2019
1 parent 33716d5 commit 8bba8e5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,13 @@ test('POST (string body w/ object url)', async t => {
});
});
});

test('custom headers', async t => {
t.plan(2);
let headers = { 'X-FOO': 'BAR123' };
let res = await httpie.get('https://reqres.in/api/users', { headers });
let sent = res.req.getHeader('x-foo');

t.is(res.statusCode, 200, '~> statusCode = 200');
t.is(sent, 'BAR123', '~> sent custom "X-FOO" header');
});

0 comments on commit 8bba8e5

Please sign in to comment.