Skip to content

Commit

Permalink
Add a test for sindresorhus#1540
Browse files Browse the repository at this point in the history
  • Loading branch information
ikorolev93 committed Nov 27, 2020
1 parent fb5f791 commit a1fd05b
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 a1fd05b

Please sign in to comment.