Update tests/library/global-fetch.spec.ts

Co-authored-by: Yury Semikhatsky <yurys@chromium.org>
Signed-off-by: JacksonLei123 <46788895+JacksonLei123@users.noreply.github.com>
This commit is contained in:
JacksonLei123 2025-02-10 22:43:24 -05:00 committed by GitHub
parent 30d9e05c15
commit b42bf792ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -556,7 +556,8 @@ it('should not throw when fetchFailOnStatusCode is set to false inside APIReques
res.writeHead(404, { 'Content-Length': 10, 'Content-Type': 'text/plain' });
res.end('Not found.');
});
const error = await request.fetch(server.EMPTY_PAGE).catch(e => e);
const response = await request.fetch(server.EMPTY_PAGE);
expect(response.status()).toBe(404);
expect(error.message).toBeUndefined();
await request.dispose();
});