Skip to content

The agent that grows with you

test(desktop): run ui test project in development mode for React act

Derek Moore9733b3fd8a16
diff --git a/apps/desktop/vitest.config.ts b/apps/desktop/vitest.config.ts
index 9c2199c323d..5409f2e054a 100644
--- a/apps/desktop/vitest.config.ts
+++ b/apps/desktop/vitest.config.ts
@@ -11,6 +11,13 @@ const reactUi: TestProjectConfiguration = {
setupFiles: ['./vitest.setup.ts'],
include: ['src/**/*.test.{ts,tsx}'],
globals: true,
+ // React 19.1+ stubs `react`.act to undefined in the production build;
+ // @testing-library/react's act() delegates to it and throws
+ // "React.act is not a function" when NODE_ENV=production. Force the
+ // development build for the test worker so `act` resolves to a real
+ // function, regardless of any ambient NODE_ENV (e.g. a shell that
+ // inherited NODE_ENV=production from a desktop launch).
+ env: { NODE_ENV: 'development' },
// The first test in each file pays jsdom env init + full module transform,
// which can exceed vitest's 5000ms default under CI/load. 15s gives the
// cold start headroom without masking genuinely hung tests. Hooks pay the