Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

setup.ts

16 lines496 Bytes

1// Setup file for SolidJS tests
2// AudioRecorder tests call blob.arrayBuffer(), which jsdom lacks — pull in the
3// shared polyfill (see packages/ai-client/tests/blob-polyfill.ts).
4import '../../ai-client/tests/blob-polyfill'
5// Mock createUniqueId to work in test environment
6import { vi } from 'vitest'
7​
8let idCounter = 0
9​
10vi.mock('solid-js', async () => {
11 const actual = await vi.importActual('solid-js')
12 return {
13 ...actual,
14 createUniqueId: () => `test-id-${idCounter++}`,
15 }
16})