feat(test-harness): vitest across workspaces + test helpers#12
Merged
Conversation
Commands: npm install --save-dev vitest npm install --save-dev gitsheets@^1.0.3 msw@^2 -w apps/api npm install --save-dev @testing-library/react@^16 @testing-library/user-event@^14 @testing-library/jest-dom@^6 @vitest/browser jsdom -w apps/web
Commands: npm pkg set scripts.test="vitest run" -w apps/api -w apps/web -w packages/shared npm pkg set scripts.test="npm run test --workspaces --if-present" npm install react-router@^7 -w apps/web
- Vitest config per workspace: node env for api/shared, jsdom for web - Root npm test fans out to all workspaces - apps/api/tests/helpers/test-repo.ts: createTestRepo (isolated git repo + gitsheets Repository) and seed (upsert records via transact) - apps/api/tests/helpers/test-private-store.ts: createTestPrivateStore (filesystem-backed shim with putProfile/getProfile/findPersonIdByEmail) - apps/api/tests/helpers/mocks.ts: createGitHubMock and createResendMock via MSW for intercepting outbound HTTP in tests - apps/web/tests/test-utils.tsx: renderWithRouter wraps RTL render with MemoryRouter for route-aware component tests - Placeholder tests in each workspace assert the harness loads - CI: add Test step before Build in ci.yml
themightychris
added a commit
that referenced
this pull request
May 16, 2026
The web vitest config uses jsdom environment, not browser mode. @vitest/browser was dead weight — nothing in the tree imports or references it.
dd39741 to
4650ae2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
npm testfans out to all workspaces in parallelcreateTestRepo+seed), filesystem-backed private store (createTestPrivateStore), and outbound HTTP mocking (createGitHubMock,createResendMockvia MSW)renderWithRouterhelper wraps RTL render in MemoryRouter;@testing-library/jest-dommatchers wired via setup fileTeststep added beforeBuildinci.ymlTest plan
npm testruns the suite from root and passes (3 api tests, 2 web tests, 1 shared test)expect(1+1).toBe(2)— proves harness loadscreateTestRepoend-to-end verified: create repo withpeoplesheet, seed a record,queryFirst, cleanupcreateTestPrivateStoreend-to-end verified:putProfile,getProfile,findPersonIdByEmail, cleanup🤖 Generated with Claude Code