Skip to content

Commit 3ebdc6a

Browse files
committed
Pin the keyless OCR path in the unreadable-document test
1 parent bb391fe commit 3ebdc6a

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

apps/sim/lib/knowledge/documents/unreadable-document.test.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@
1010
*/
1111
import { describe, expect, it, vi } from 'vitest'
1212

13-
const { mockParseBuffer, mockDownload } = vi.hoisted(() => ({
14-
mockParseBuffer: vi.fn(),
15-
mockDownload: vi.fn(),
16-
}))
13+
const { mockParseBuffer, mockDownload } = vi.hoisted(() => {
14+
// A developer's .env MISTRAL_API_KEY would route the empty-parse case into
15+
// the OCR/cloud-upload branch and fail on unmocked uploads; CI has no key.
16+
// Pin the keyless path so the test is hermetic.
17+
process.env.MISTRAL_API_KEY = ''
18+
return {
19+
mockParseBuffer: vi.fn(),
20+
mockDownload: vi.fn(),
21+
}
22+
})
1723

1824
vi.mock('@/lib/file-parsers', () => ({
1925
parseBuffer: mockParseBuffer,

0 commit comments

Comments
 (0)