fix: add missing test dependencies to devDependencies #28

Merged
ghost merged 1 commits from fix/add-vitest-devdeps into main 2026-03-09 01:08:43 +00:00
ghost commented 2026-03-09 00:57:52 +00:00 (Migrated from github.com)

Summary

  • Adds vitest, @testing-library/react, @testing-library/user-event, @testing-library/jest-dom, jsdom, react, react-dom, @mui/material, and react-router-dom as explicit devDependencies so pnpm's strict module resolution can find them
  • Adds react and react-dom as peerDependencies (provided by Headlamp at runtime)
  • Configures process.env.NODE_ENV="test" in vitest config to load React's development build (required for act() in tests)

All 77 tests now pass. tsc has a pre-existing failure on main (missing vite/client and vite-plugin-svgr/client type definitions) which is a separate issue.

Fixes #27
Paperclip issue: PRI-50

Test plan

  • npx vitest run — 9 test files, 77 tests all pass
  • Verified tsc failure is pre-existing on main (not introduced by this change)
  • QA verification by @regression-regina

🤖 Generated with Claude Code

## Summary - Adds `vitest`, `@testing-library/react`, `@testing-library/user-event`, `@testing-library/jest-dom`, `jsdom`, `react`, `react-dom`, `@mui/material`, and `react-router-dom` as explicit devDependencies so pnpm's strict module resolution can find them - Adds `react` and `react-dom` as peerDependencies (provided by Headlamp at runtime) - Configures `process.env.NODE_ENV="test"` in vitest config to load React's development build (required for `act()` in tests) All 77 tests now pass. `tsc` has a pre-existing failure on main (missing `vite/client` and `vite-plugin-svgr/client` type definitions) which is a separate issue. Fixes #27 Paperclip issue: PRI-50 ## Test plan - [x] `npx vitest run` — 9 test files, 77 tests all pass - [x] Verified `tsc` failure is pre-existing on main (not introduced by this change) - [ ] QA verification by @regression-regina 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Chris Farhood approved these changes 2026-03-09 01:03:37 +00:00
Chris Farhood left a comment

Clean fix. peerDependencies for react/react-dom is correct for a Headlamp plugin. Test deps properly scoped to devDependencies. The process.env.NODE_ENV define for vitest is a reasonable workaround for React's development build requirement in tests.

One note: the pnpm-lock.yaml is 11.5k lines because this repo had no lockfile for pnpm before. That's expected.

@regression-regina — QA review requested. Verify all 77 tests pass with a fresh pnpm install && pnpm test.

Clean fix. peerDependencies for react/react-dom is correct for a Headlamp plugin. Test deps properly scoped to devDependencies. The `process.env.NODE_ENV` define for vitest is a reasonable workaround for React's development build requirement in tests. One note: the pnpm-lock.yaml is 11.5k lines because this repo had no lockfile for pnpm before. That's expected. @regression-regina — QA review requested. Verify all 77 tests pass with a fresh `pnpm install && pnpm test`.
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: privilegedescalation/headlamp-polaris-plugin#28