π¬ A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots π
TypeScript browser-extensionchrome-extensiondocumentationfirefox-extensionguide-generatorlocal-firstmanifest-v3privacy-firstproductivityreactscreenshotstep-by-step-guidetutorialtypescriptworkflowwxt
fix: add null assertions for TypeScript strict mode in validate tests
alvinlolloee5d7b7aff77
diff --git a/src/core/capture/ai/__tests__/validate.test.ts b/src/core/capture/ai/__tests__/validate.test.tsindex c59622a..07ec3bc 100644--- a/src/core/capture/ai/__tests__/validate.test.ts+++ b/src/core/capture/ai/__tests__/validate.test.ts@@ -71,7 +71,7 @@ describe('validateApiKey', () => {expect(await validateApiKey('groq', 'gsk-key')).toEqual({ valid: true, models: ['ok-model'] });const [url, init] = fetchMock.mock.calls[0];expect(url).toBe('https://api.groq.com/openai/v1/models');- expect(init.headers.Authorization).toBe('Bearer gsk-key');+ expect(init!.headers.Authorization).toBe('Bearer gsk-key');});it('checks a deepseek key against deepseek, not openai', async () => {@@ -79,14 +79,14 @@ describe('validateApiKey', () => {expect(await validateApiKey('deepseek', 'sk-deepseek')).toEqual({ valid: true, models: ['deepseek-v4-flash'] });const [url, init] = fetchMock.mock.calls[0];expect(url).toBe('https://api.deepseek.com/models');- expect(init.headers.Authorization).toBe('Bearer sk-deepseek');+ expect(init!.headers.Authorization).toBe('Bearer sk-deepseek');});it('gives up rather than spinning forever when a host never answers', async () => {fetchMock.mockResolvedValueOnce(jsonResponse(null));await validateApiKey('openai', 'sk-key');const [, init] = fetchMock.mock.calls[0];- expect(init.signal).toBeInstanceOf(AbortSignal);+ expect(init!.signal).toBeInstanceOf(AbortSignal);});it('never sends a key to an unknown provider, and does not call it rejected', async () => {