Skip to content

Commit a1fd05b

Browse files
committed
Add a test for sindresorhus#1540
1 parent fb5f791 commit a1fd05b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/promise.ts

+10
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,13 @@ test('promise.json() can be called before a file stream body is open', withServe
7979

8080
await Promise.all(checks);
8181
});
82+
83+
test.failing('promise.json() does not fail when server returns an error', withServer, async (t, server, got) => {
84+
server.get('/', (_request, response) => {
85+
response.statusCode = 400;
86+
response.end('{}');
87+
});
88+
89+
const promise = got('', {throwHttpErrors: false});
90+
await t.notThrowsAsync(promise.json());
91+
});

0 commit comments

Comments
 (0)