Repository navigation
Description
Summary
services/platform/vitest.config.ts defines a client project (jsdom, tests/setup-ui.ts) that nothing in the repository runs. CI and bun run check run the jsdom suite through vitest.ui.config.ts (test:ui). The two configurations differ, and so do their results:
- 3 tests in
api-key-create-dialog.test.tsxfail under theclientproject and pass undervitest.ui.config.ts. - The
clientproject leaves out the 35 test files underapp/routes/.
A local check of the chat agents epic (#5371) ran the client project. It reported those 3 tests as failing on main, and it missed 6 route tests that test:ui then caught (fixed in f163a9c90).
What the repository says today (main 9be27c4e2)
- The
clientproject:services/platform/vitest.config.ts:142-156. It setsenvironment: 'jsdom',setupFiles: ['./tests/setup-ui.ts'], and includesapp/components,app/featuresandapp/hooks. It inherits the root's plugins (YAML imports, message topics),resolve.dedupeandoptimizeDeps. services/platform/vitest.ui.config.ts:23-87addsreact(),globals: true,pool: 'threads',maxWorkers,onConsoleLog,css: trueand adeps.optimizer.weblist. It also includesapp/routes/**and excludesbackend/**.- Scripts:
testruns--project server --project pii, andtest:uirunsvitest.ui.config.ts(services/platform/package.json:20,:26). CI runstest:uiin four shards (.github/workflows/checks.yml:487). No script, workflow or doc names--project client. - A bare
bunx vitest --runinservices/platformruns every project ofvitest.config.ts, theclientandstorybookprojects included.
What was observed (macOS, Bun 1.4.2, 2026-11-05)
| Command | api-key-create-dialog.test.tsx |
|---|---|
bunx vitest --run --project client <file> |
3 failed, 24 passed: "Unable to perform pointer interaction as the element has pointer-events: none" on the calendar's day cells and on Previous month |
the same with TZ=UTC |
the same 3 fail |
the same with --pool=threads --globals |
the same 3 fail |
bunx vitest --run --config vitest.ui.config.ts <file> |
27 passed |
The test fakes the clock (vi.useFakeTimers({ toFake: ['Date'] }), setSystemTime to 2026-10-07), so the date it runs on does not matter.
Not examined: which remaining difference causes the failures (react(), css: true, the optimizer list, dedupe); whether an editor's Vitest extension runs the client project.
Options (no preference)
- Remove the
clientproject, sovitest.ui.config.tsis the one jsdom suite. - Define the jsdom suite once and use it in both places: the
clientproject points at thevitest.ui.config.tssettings, or the other way round. - Keep both, with a guard that they include the same files and run the same way.
Activity
test(platform): define the jsdom suite once, in vitest.ui.config.ts
test(platform): word the guard's jsdom hint so Knip reads no package
test(platform): word the guard's jsdom hint so Knip reads no package