From b42bf792edc664b03355f1215d5fcb7459a5d6e8 Mon Sep 17 00:00:00 2001 From: JacksonLei123 <46788895+JacksonLei123@users.noreply.github.com> Date: Mon, 10 Feb 2025 22:43:24 -0500 Subject: [PATCH] Update tests/library/global-fetch.spec.ts Co-authored-by: Yury Semikhatsky Signed-off-by: JacksonLei123 <46788895+JacksonLei123@users.noreply.github.com> --- tests/library/global-fetch.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/library/global-fetch.spec.ts b/tests/library/global-fetch.spec.ts index 16166bb26c..93d8179bc0 100644 --- a/tests/library/global-fetch.spec.ts +++ b/tests/library/global-fetch.spec.ts @@ -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(); });