diff --git a/ui/vitest.config.ts b/ui/vitest.config.ts index 370ad40..dfc9ffa 100644 --- a/ui/vitest.config.ts +++ b/ui/vitest.config.ts @@ -2,6 +2,12 @@ import { defineConfig } from "vitest/config"; import react from "@vitejs/plugin-react"; import { resolve } from "path"; +// React 19's CJS entry picks production vs development at require-time off +// NODE_ENV; the production build omits `act`. Force the test build before any +// worker forks so callers with NODE_ENV=production (CI-adjacent shells, the +// Paperclip agent harness) get the same result as bare `npm test`. +process.env.NODE_ENV = "test"; + export default defineConfig({ plugins: [react()], resolve: {