From ac4f29e396bbce5008130051292af156aba6e814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Mon, 10 Feb 2025 19:37:31 +0100 Subject: [PATCH] Assert `response.ok` when downloading files --- packages/compass-smoke-tests/src/downloads.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/compass-smoke-tests/src/downloads.ts b/packages/compass-smoke-tests/src/downloads.ts index 49ed7815cf8..3b37a86bc8b 100644 --- a/packages/compass-smoke-tests/src/downloads.ts +++ b/packages/compass-smoke-tests/src/downloads.ts @@ -18,6 +18,10 @@ export async function downloadFile({ }: DownloadFileOptions): Promise { const response = await fetch(url); + assert( + response.ok, + `Request failed with status ${response.status} (${response.statusText})` + ); const etag = response.headers.get('etag'); assert(etag, 'Expected an ETag header'); const cleanEtag = etag.match(/[0-9a-fA-F]/g)?.join('');