fixed test

Signed-off-by: Alex Lorenzi <alorenzi@spotify.com>
This commit is contained in:
Alex Lorenzi
2025-02-13 12:46:57 -05:00
parent 840a2687fe
commit 76c91c11cb
+10 -2
View File
@@ -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);