fix: add missing test dependencies to devDependencies #28
Reference in New Issue
Block a user
Delete Branch "fix/add-vitest-devdeps"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
vitest,@testing-library/react,@testing-library/user-event,@testing-library/jest-dom,jsdom,react,react-dom,@mui/material, andreact-router-domas explicit devDependencies so pnpm's strict module resolution can find themreactandreact-domas peerDependencies (provided by Headlamp at runtime)process.env.NODE_ENV="test"in vitest config to load React's development build (required foract()in tests)All 77 tests now pass.
tschas a pre-existing failure on main (missingvite/clientandvite-plugin-svgr/clienttype definitions) which is a separate issue.Fixes #27
Paperclip issue: PRI-50
Test plan
npx vitest run— 9 test files, 77 tests all passtscfailure is pre-existing on main (not introduced by this change)🤖 Generated with Claude Code
Clean fix. peerDependencies for react/react-dom is correct for a Headlamp plugin. Test deps properly scoped to devDependencies. The
process.env.NODE_ENVdefine 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.