Skip to content

Conversation

@winsznx
Copy link

@winsznx winsznx commented Dec 19, 2025

I've created a comprehensive PR description document that you can use. The key highlights are:

Summary:

🧪 Testing Infrastructure - Vitest setup with coverage (60% thresholds)

🚀 CI/CD Modernization - GitHub Actions v4, new test & build workflows

🔒 Security Best Practices - SECURITY.md, Dependabot, environment validation

Changes:

✅ 15 commits created (viewable in git log)

✅ 9 new files, 6 modified files

✅ All backwards compatible and non-breaking

✅ Follows conventional commit format

Commit Breakdown:

✅ test: configure Vitest with coverage and jsdom environment

✅ test: add global test setup file

✅ test: create test utilities with custom render function

✅ chore: add test scripts and testing dependencies

✅ chore: update lockfile for testing dependencies

✅ ci: upgrade check-format workflow to use actions v4

✅ ci: upgrade check-lint workflow to use actions v4

✅ ci: upgrade check-types workflow to use actions v4

✅ ci: add automated test workflow with coverage reporting

✅ ci: add build verification workflow

✅ ci: configure Dependabot for automated dependency updates

✅ docs: add security policy and vulnerability reporting guidelines

✅ docs: add environment variable example file

✅ feat: add runtime environment variable validation

✅ feat: integrate environment validation at app startup

- Add Vitest configuration with V8 coverage provider
- Set coverage thresholds at 60% for all metrics
- Configure jsdom environment for React component testing
- Exclude test files and configs from coverage reports
- Configure automatic cleanup after each test
- Add window.matchMedia mock for browser API compatibility
- Filter console errors to suppress common test warnings
- Integrate jest-dom matchers for better assertions
- Build custom render wrapping components with QueryClient and Router
- Create test-specific QueryClient with disabled retry/caching
- Export testing-library utilities for convenience
- Add helper functions for mocks and async testing
- Add test, test:watch, and test:coverage scripts
- Update check:all to include automated tests
- Install testing-library packages and [email protected]
- Add coverage tooling (@vitest/coverage-v8, @vitest/ui)
- Upgrade actions/checkout from v3 to v4
- Upgrade actions/setup-node from v3 to v4
- Pin Node.js version to 20.x for consistency
- Upgrade actions/checkout from v3 to v4
- Upgrade actions/setup-node from v3 to v4
- Pin Node.js version to 20.x for consistency
- Upgrade actions/checkout from v3 to v4
- Upgrade actions/setup-node from v3 to v4
- Pin Node.js version to 20.x for consistency
- Run tests on every PR and merge group event
- Generate coverage reports with multiple formats
- Upload coverage to Codecov (optional)
- Use latest GitHub Actions (v4)
- Verify production builds succeed on every PR
- Check for build output (dist directory)
- Prevent build-breaking changes from being merged
- Use Node.js 20.x and latest actions
- Enable weekly npm dependency updates (Mondays at 9am)
- Group development and production dependencies separately
- Configure GitHub Actions workflow updates
- Set PR limits and automatic labeling
- Add reviewers and commit message prefixes
- Document supported versions receiving security updates
- Provide clear vulnerability reporting instructions
- Define disclosure policy and expected timelines
- Include contact methods and best practices
- Outline acknowledgment and fix timelines
- Document all available environment variables
- Provide safe default values and usage examples
- Include comments for required vs optional variables
- Cover app version, analytics, network config, and feature flags
- Create validateEnv() function with type-safe config
- Add EnvValidationError with helpful error messages
- Provide utility functions for env access
- Log validation success in development mode
- Ensure required variables are present at startup
- Add validateEnv() call before app initialization
- Fail fast with clear errors if required variables missing
- Prevent app from running with invalid configuration
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.

1 participant