Introduces vitest config, jsdom setup, and first suites covering FieldRenderer dispatch and useConditionalLogic evaluation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
19 lines
583 B
TypeScript
19 lines
583 B
TypeScript
import { vi } from 'vitest'
|
|
|
|
// Deterministic idempotency-key generation for useFormDraft tests.
|
|
if (!globalThis.crypto) {
|
|
;(globalThis as { crypto: Crypto }).crypto = {
|
|
randomUUID: () => '00000000-0000-4000-8000-000000000000',
|
|
getRandomValues: (buf: Uint8Array) => {
|
|
for (let i = 0; i < buf.length; i++) buf[i] = 0
|
|
return buf
|
|
},
|
|
} as unknown as Crypto
|
|
}
|
|
|
|
// Suppress Vue-router usage in isolated composable tests.
|
|
vi.mock('vue-router', () => ({
|
|
useRoute: () => ({ params: {}, query: {} }),
|
|
useRouter: () => ({ push: vi.fn(), replace: vi.fn() }),
|
|
}))
|