Skip to content

Commit

Permalink
added test
Browse files Browse the repository at this point in the history
  • Loading branch information
archvlad committed Mar 5, 2024
1 parent 57e1486 commit 4a219ef
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/error.ts
Expand Up @@ -343,6 +343,23 @@ test('no uncaught parse errors #2', async t => {
await close();
});

test('no uncaught parse errors on fall back to utf8', withServer, async (t, server, got) => {
server.get('/', (_request, response) => {
const buffer = Buffer.alloc(536_870_912, 'A');
response.statusCode = 200;
response.end(buffer);
});

await t.throwsAsync(got({
timeout: {
request: 60_000,
},
}), {
instanceOf: RequestError,
code: 'ERR_BODY_PARSE_FAILURE',
});
});

// Fails randomly on Node 10:
// Blocked by https://github.com/istanbuljs/nyc/issues/619
// eslint-disable-next-line ava/no-skip-test
Expand Down

0 comments on commit 4a219ef

Please sign in to comment.