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 118e9d2
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, 'A');
response.statusCode = 200;

Check failure on line 349 in test/error.ts

View workflow job for this annotation

GitHub Actions / Node.js 20 on macos-latest

Mixed spaces and tabs.
response.end(buffer);

Check failure on line 350 in test/error.ts

View workflow job for this annotation

GitHub Actions / Node.js 20 on macos-latest

Mixed spaces and tabs.
});

await t.throwsAsync(got({
timeout: {
request: 60_000,
},
}), {
instanceOf: RequestError,
message: /^Parse Error/,
});
});

// 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 118e9d2

Please sign in to comment.