diff --git a/packages/insomnia-cookies/src/cookies.test.ts b/packages/insomnia-cookies/src/cookies.test.ts index 05e0939e3..05f3df12c 100644 --- a/packages/insomnia-cookies/src/cookies.test.ts +++ b/packages/insomnia-cookies/src/cookies.test.ts @@ -24,6 +24,7 @@ describe('jarFromCookies()', () => { }); it('handles malformed JSON', () => { + jest.spyOn(console, 'log').mockImplementationOnce(() => {}); // @ts-expect-error this test is verifying that an invalid input is handled appropriately const jar = jarFromCookies('not a jar'); expect(jar.constructor.name).toBe('CookieJar'); @@ -59,12 +60,11 @@ describe('cookiesFromJar()', () => { it('handles bad jar', async () => { const jar = CookieJar.fromJSON({ cookies: [] }); - + jest.spyOn(console, 'warn').mockImplementationOnce(() => {}); // MemoryStore never actually throws errors, so lets mock the function to force it to this time. // @ts-expect-error intentionally invalid value jar.store.getAllCookies = cb => cb(new Error('Dummy Error')); const cookies = await cookiesFromJar(jar); - // Cookies failed to parse expect(cookies.length).toBe(0); });