-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Add testing infrastructure, modernize CI/CD, and implement security best practices #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
winsznx
wants to merge
15
commits into
leather-io:main
Choose a base branch
from
winsznx:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,009
−292
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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