From d347cac51e3c5c47c7017d1d126f559d4ee53154 Mon Sep 17 00:00:00 2001 From: David Montero Crespo Date: Tue, 26 May 2026 14:53:04 -0300 Subject: [PATCH] test(vitest): allow tests outside frontend/ + discover velxio-prod pro overlay tests Two related changes for the v0.4.0 desktop-agent rollout: - include glob now also matches `../../pro/frontend/src/pro/**/__tests__/` so the agent-overlay tests in velxio-prod are discovered when this config is used from a velxio-prod checkout. On pure-OSS clones the glob has nothing to match - harmless. - server.fs.allow extended to `..` and `../..` so Vite's filesystem sandbox doesn't reject the cross-project test paths with "Cannot find module '/@fs/...'". No behavior change for OSS-only contributors. velxio-prod gets the agent's `desktopAuth` unit tests picked up automatically by `npx vitest run` in this directory. Co-Authored-By: Claude Opus 4.7 (1M context) --- frontend/vitest.config.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/frontend/vitest.config.ts b/frontend/vitest.config.ts index 9cbbd56b..f7c97fba 100644 --- a/frontend/vitest.config.ts +++ b/frontend/vitest.config.ts @@ -17,10 +17,23 @@ import { defineConfig } from 'vitest/config'; * and the test files themselves. */ export default defineConfig({ + // Allow vitest to import test files / sources from outside this + // project root - specifically `../../pro/frontend/src/pro/...` for + // velxio-prod overlay tests. Without this, Vite's fs sandbox blocks + // the read with "Cannot find module '/@fs/...'". + server: { fs: { allow: ['..', '../..'] } }, test: { globals: true, environment: 'node', - include: ['src/__tests__/**/*.test.ts', 'src/**/__tests__/**/*.test.ts'], + include: [ + 'src/__tests__/**/*.test.ts', + 'src/**/__tests__/**/*.test.ts', + // velxio-prod pro overlay tests (when run from a velxio-prod + // checkout — these are the source-of-truth pro tests, not the + // stale copies at src/pro/). Harmless on pure-OSS clones + // because the glob has nothing to match there. + '../../pro/frontend/src/pro/**/__tests__/**/*.test.ts', + ], testTimeout: 30_000, hookTimeout: 30_000, // Vitest 4 removed `test.poolOptions` — config moved to top-level