Skip to content

Commit

Permalink
Add a test for promise.json() (#1541)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikorolev93 authored Nov 27, 2020
1 parent fb5f791 commit 1107cc6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/promise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,13 @@ test('promise.json() can be called before a file stream body is open', withServe

await Promise.all(checks);
});

test.failing('promise.json() does not fail when server returns an error', withServer, async (t, server, got) => {
server.get('/', (_request, response) => {
response.statusCode = 400;
response.end('{}');
});

const promise = got('', {throwHttpErrors: false});
await t.notThrowsAsync(promise.json());
});

0 comments on commit 1107cc6

Please sign in to comment.