test: switch integration project to folder-based manifest (#1314)#1318
Conversation
Replace the `integrationTests` enumeration in vite.config.ts with a folder glob (`src/test/integration/**/*.test.ts`). Files under that folder run in the integration vitest project (node env, 30s timeouts); everything else runs in the unit project (happy-dom). This removes the silent misclassification trap from #1307: a new integration-style test no longer falls into the unit project (and happy-dom) just because someone forgot to add it to the array. The 13 ported v1.5 tests + their helpers move under src/test/integration/ in a strict mirror of core/ source layout (mcp/, auth/, auth/node/, storage/). Renames use git mv so history is preserved. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@claude review |
|
Claude finished @cliffhall's task in 3m 2s —— View job Claude PR Review
SummaryThe folder-manifest change is a clear win. Swapping the 13-entry Findings1. Doc drift in
After this PR, both halves of that second sentence are wrong: integration tests live under
2. Glob extension mismatch partially reintroduces the trap this PR is closing // clients/web/vite.config.ts:79
const integrationGlob = 'clients/web/src/test/integration/**/*.test.ts';vs. the unit project: // clients/web/vite.config.ts:170
include: ['clients/web/src/**/*.test.{ts,tsx}'],
exclude: [integrationGlob],A hypothetical
Net effect: a Integration tests today are all
Nits (non-blocking)
VerdictApprove with the two fixes above (AGENTS.md and the glob extension). The refactor is small, reversible, and genuinely closes a class of bug — net positive. |
- vite.config.ts: widen integrationGlob from `*.test.ts` to
`*.test.{ts,tsx}` so the integration folder fully owns its contents.
Without this, a `.test.tsx` placed under src/test/integration/ would
match the unit project's `{ts,tsx}` include, fail the unit `.ts`-only
exclude, and silently land under happy-dom — the exact misclassification
trap this PR set out to close.
- AGENTS.md: update the line describing where integration tests live;
it still pointed at the old `src/test/core/` location and the removed
`integrationTests` enumeration.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Thanks for the review — both findings addressed in 2a87127. 1. 2. Glob extension mismatch ( Nits — kept as-is:
|
|
@claude review |
|
Claude finished @cliffhall's task in 1m 1s —— View job Claude PR Review (follow-up on 2a87127)
Verdict — looks good, ready to mergeBoth prior findings are cleanly addressed by 2a87127. No new concerns. Findings re-verification1. Old line's two incorrect claims ( 2. Glob extension mismatch — fixed ( const integrationGlob = 'clients/web/src/test/integration/**/*.test.{ts,tsx}';Now symmetric with the unit project's Extra verification I did
|
Summary
integrationTestsarray inclients/web/vite.config.tswith a folder glob:clients/web/src/test/integration/**/*.test.ts. Files under that folder run in theintegrationvitest project (node env, 30s timeouts); everything else stays inunit(happy-dom).helpers/oauth-client-fixtures.tsfixture undersrc/test/integration/as a strict mirror ofcore/:mcp/(5inspectorClient*tests),mcp/node/transport.test.ts,mcp/remote/{transport,server-config}.test.tsstorage/adapters.test.tsauth/{discovery,state-machine}.test.ts,auth/node/{storage,oauth-callback-server}.test.tsgit mvso history is preserved (98–100% similarity).tsconfig.test.jsonalready globssrc/test/**/*.ts, so no change needed there.Acceptance criteria
includeglob owns, and unit'sincludeexcludes — no explicit enumeration.src/test/integration/runs in node env automatically; outside, happy-dom.npm run test:integrationpasses (13 files, 331 tests — count grew from 298 since Run v1.5-ported integration tests under a node-env vitest project (#1302 follow-up) #1307 landed).npm run validatepasses (1108 unit + 331 integration tests, lint/build/format/coverage gate clean).npm run test:storybookpasses (67 files, 298 tests).Test plan
npm run test— unit suite (1108 passed)npm run test:integration— integration suite (331 passed)npm run validate— format/lint/build/coverage all greennpm run test:storybook— story plays passCloses #1314
🤖 Generated with Claude Code