Skip to content

feat(api): Add health check endpoint, fix tests, enforce npm#949

Merged
jeromehardaway merged 5 commits into
masterfrom
feat/health-endpoint
Feb 7, 2026
Merged

feat(api): Add health check endpoint, fix tests, enforce npm#949
jeromehardaway merged 5 commits into
masterfrom
feat/health-endpoint

Conversation

@gixxerblade

@gixxerblade gixxerblade commented Feb 7, 2026

Copy link
Copy Markdown
Collaborator
  • Add GET /api/health endpoint with DB connectivity check, env var validation, and structured status response (healthy/degraded/unhealthy)
  • Add unit tests for health endpoint with 100% coverage
  • Fix media.tests.tsx import path and mdx-pages mock
  • Fix projects.tests.tsx type annotations and VWCContributor mock fields
  • Fix getStaticProps error test to match graceful-degradation behavior
  • Enforce npm via only-allow preinstall script, remove yarn.lock
  • Replace yarn references in scripts with npm run
  • Replace Jest with Vitest v4 + happy-dom environment
  • Add vitest.config.mts with path aliases, React plugin, PostCSS bypass
  • Update all test files: jest.mock → vi.mock, jest.fn → vi.fn, jest.spyOn → vi.spyOn
  • Use vitest-dom for proper matcher type declarations
  • Switch dynamic imports from require() to await import() for Vite alias resolution
  • Add vitest.yml workflow
  • Remove jest, ts-jest, jest-environment-jsdom, @types/jest
  • Add vitest, @vitest/coverage-v8, happy-dom, @vitejs/plugin-react, vitest-dom

✅ All 116 tests pass across 9 test files in ~800ms

- Add GET /api/health endpoint with DB connectivity check, env var
  validation, and structured status response (healthy/degraded/unhealthy)
- Add unit tests for health endpoint with 100% coverage
- Fix media.tests.tsx import path and mdx-pages mock
- Fix projects.tests.tsx type annotations and VWCContributor mock fields
- Fix getStaticProps error test to match graceful-degradation behavior
- Exclude src/ from Jest test path to prevent API routes running as tests
- Enforce npm via only-allow preinstall script, remove yarn.lock
- Replace yarn references in scripts with npm run
@vercel

vercel Bot commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
vets-who-code-app Ready Ready Preview, Comment Feb 7, 2026 6:42pm

Request Review

- Add jest.yml workflow to run unit tests on push/PR to master
- Migrate playwright.yml from yarn to npm (npm ci, npm run, npx)
- Update cache keys from yarn.lock to package-lock.json
- Update setup-node action to v4
- Target master branch only in both workflows
- Replace Jest with Vitest v4 + happy-dom environment
- Add vitest.config.mts with path aliases, React plugin, PostCSS bypass
- Update all test files: jest.mock → vi.mock, jest.fn → vi.fn, jest.spyOn → vi.spyOn
- Use vitest-dom for proper matcher type declarations
- Switch dynamic imports from require() to await import() for Vite alias resolution
- Rename CI workflow jest.yml → vitest.yml
- Remove jest, ts-jest, jest-environment-jsdom, @types/jest
- Add vitest, @vitest/coverage-v8, happy-dom, @vitejs/plugin-react, vitest-dom

All 116 tests pass across 9 test files in ~800ms
@gixxerblade gixxerblade self-assigned this Feb 7, 2026
@gixxerblade gixxerblade added enhancement dependencies Pull requests that update a dependency file testing cleanup Code cleanup and maintenance unit-tests Unit testing related labels Feb 7, 2026
- Restore import/no-unresolved, import/extensions,
  react/function-component-definition, and
  jsx-a11y/label-has-associated-control back to error severity
- Add vitest.config.mts to ESLint test override files array
- Fix indentation on vitest.config.mts exclude property
- Remove redundant inline eslint-disable comment
- react/function-component-definition and
  jsx-a11y/label-has-associated-control fail across dozens of
  existing files, blocking the build
- Keep import/no-unresolved and import/extensions as error
@jeromehardaway jeromehardaway merged commit 4811ae0 into master Feb 7, 2026
6 checks passed
@jeromehardaway jeromehardaway deleted the feat/health-endpoint branch February 7, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Code cleanup and maintenance dependencies Pull requests that update a dependency file enhancement testing unit-tests Unit testing related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants