Skip to content

Add Vitest test infrastructure and unit tests#59

Open
saynchowdhury wants to merge 4 commits into
mainfrom
feat/add-unit-tests
Open

Add Vitest test infrastructure and unit tests#59
saynchowdhury wants to merge 4 commits into
mainfrom
feat/add-unit-tests

Conversation

@saynchowdhury

@saynchowdhury saynchowdhury commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

Adds comprehensive unit test coverage for the Foundery.Space application.

Test Infrastructure

  • Vitest configured with @testing-library/react and jsdom
  • pnpm-lock.yaml updated with all test dependencies

Tests Added (87 total)

  • OpportunityCard component (18 tests)
  • lib/data.ts (23 tests)
  • lib/categories.ts (21 tests)
  • lib/utils.ts (25 tests)

This PR was created by an AI agent on behalf of the user.

Summary by CodeRabbit

  • Chores
    • Updated TypeScript to a newer version and moved it to development-only dependencies.
    • No user-facing behavior changes are included in this update.

Co-authored-by: openhands <openhands@all-hands.dev>
@supabase

supabase Bot commented Jul 3, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project tpvpacwoquygbykcjqle because there are no changes detected in /supabase/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
foundery.space Error Error Jul 3, 2026 1:59pm

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@saynchowdhury, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 30 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 34b15eea-3cb7-4268-bae2-2afcaed66024

📥 Commits

Reviewing files that changed from the base of the PR and between d2a616b and 7e81e48.

📒 Files selected for processing (3)
  • .npmrc
  • tsconfig.json
  • vitest.setup.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-unit-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@entelligence-ai-pr-reviews

entelligence-ai-pr-reviews Bot commented Jul 3, 2026

Copy link
Copy Markdown

EntelligenceAI PR Summary

This PR tightens TypeScript configuration and improves type compliance in the test setup.

  • tsconfig.json: Added exclusion patterns for *.test.ts, *.test.tsx, *.spec.ts, *.spec.tsx, vitest.setup.tsx, and vitest.config.ts to prevent test files from being included in the production build
  • vitest.setup.tsx: Refactored IntersectionObserver mock from an anonymous class to a named MockIntersectionObserver class with full interface compliance, including required readonly properties and typed parameters

Confidence Score: 5/5 - Safe to Merge

Safe to merge — this PR makes targeted, low-risk improvements to the test infrastructure by excluding test files from the production TypeScript build via tsconfig.json exclusion patterns, and by upgrading the IntersectionObserver mock in vitest.setup.tsx to a named MockIntersectionObserver class with full interface compliance. Both changes are strictly scoped to the test configuration layer and have no runtime impact on production code. No review comments were generated, all four changed files were reviewed, and no pre-existing unresolved concerns are outstanding.

Key Findings:

  • The tsconfig.json exclusion of *.test.ts, *.test.tsx, *.spec.ts, *.spec.tsx, vitest.setup.tsx, and vitest.config.ts correctly prevents test artifacts from polluting the production build output — a positive hygiene improvement with no downside risk.
  • Refactoring the anonymous IntersectionObserver mock to the named MockIntersectionObserver class with required readonly properties in vitest.setup.tsx improves TypeScript strict-mode compliance and makes the mock easier to reference and debug in test output.
  • All four changed files were reviewed with zero issues identified at any severity level, and there are no unresolved pre-existing comments, giving high confidence that no regressions are introduced.
Files requiring special attention
  • tsconfig.json
  • vitest.setup.tsx

- Upgrade TypeScript to 5.7.3 (required for @vitejs/plugin-react 6.x)
- Keep @vitejs/plugin-react at 6.0.3 (compatible with latest)

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
- Fix IntersectionObserver mock to properly implement the interface
- Exclude test files from Next.js type checking in tsconfig.json

Co-authored-by: openhands <openhands@all-hands.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants