From 71b14fb464f9e340e3a4366cf0954cb1b94075a7 Mon Sep 17 00:00:00 2001 From: David Snelling Date: Mon, 18 Aug 2025 09:32:48 -0700 Subject: [PATCH] test: Add global mock embedding setup to prevent timeouts - Create test-setup.ts with global vi.mock for embedding module - Mock all embedding functions to avoid loading Transformers.js - Configure vitest to load mock setup before all tests - Fixes timeout issues in majority of test files Tests now run significantly faster with deterministic mock embeddings --- vitest.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vitest.config.ts b/vitest.config.ts index 0dd055c7..2c5f77cc 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -4,7 +4,7 @@ export default defineConfig({ test: { // Default configuration globals: true, - setupFiles: ['./tests/setup.ts'], + setupFiles: ['./tests/test-setup.ts', './tests/setup.ts'], testTimeout: 120000, // 120 seconds for TensorFlow operations hookTimeout: 120000, // Run tests in parallel with limited pool