From 76c91c11cb08ee9713e46ccea42b17fc19b061d2 Mon Sep 17 00:00:00 2001 From: Alex Lorenzi Date: Thu, 13 Feb 2025 12:46:57 -0500 Subject: [PATCH] fixed test Signed-off-by: Alex Lorenzi --- plugins/techdocs/src/client.test.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/techdocs/src/client.test.ts b/plugins/techdocs/src/client.test.ts index f66587a071..70c5f3568e 100644 --- a/plugins/techdocs/src/client.test.ts +++ b/plugins/techdocs/src/client.test.ts @@ -180,7 +180,11 @@ describe('TechDocsStorageClient', () => { mockFetchEventSource.mockImplementation(async (_url, options) => { const { onerror } = options; - onerror?.(new NotFoundError('Some not found warning')); + try { + onerror?.(new NotFoundError('Some not found warning')); + } catch (e) { + // do nothing + } }); // we await later after we emitted the error @@ -202,7 +206,11 @@ describe('TechDocsStorageClient', () => { mockFetchEventSource.mockImplementation(async (_url, options) => { const { onerror } = options; - onerror?.(new Error('Some other error')); + try { + onerror?.(new Error('Some other error')); + } catch (e) { + // do nothing + } }); await expect(promise).rejects.toThrow(Error);