- Setting up automated testing infrastructure
- Implementing test coverage reporting and monitoring
- Improving API endpoint input validation and error handling
- Set up Jest testing framework with ES module support
- Created comprehensive test suite for API endpoints
- Configured GitHub Actions for automated testing
- Integrated Codecov for test coverage reporting
- Added input validation and error handling to serverless functions
- Fixed off-by-one event date bug by replacing naive Date('YYYY-MM-DD') parsing with component-based local construction (src/utils/date.ts) and updated calendar URL generation; added unit tests for the new date utilities.
- Updated documentation with testing instructions
- Added GitHub Actions and Codecov badges to README
- Jest runs tests with ESM support
- Mock API responses using
nock - Environment variables configured in test setup
- Added unit tests for date utilities (src/utils/date.ts) to validate local date construction and formatting.
- GitHub Actions runs tests on push and pull requests
- Coverage reports uploaded to Codecov
- Branch-specific coverage tracking
- Coverage thresholds set at 70%
__tests__/api/events.test.js: Event listing endpoint tests__tests__/api/eventDetails.test.js: Event details endpoint tests__tests__/setup/testSetup.js: Global test configuration__tests__/utils/testUtils.js: Shared test utilities
- Frontend runs on Vite dev server
- Backend uses Vercel dev server for serverless functions
- Environment variables defined in
.env.template:VERCEL_DEV_PORT=3000RADIUS=50RADIUS_UNIT=milesDEFAULT_EVENTS_PER_PAGE=7
vercel.json: Routes API requests and handles CORSvite.config.ts: Proxies API requests during developmentjest.config.js: Test configuration with ESM supportcodecov.yml: Coverage reporting configuration- Serverless functions in
/apidirectory
- Issue: HTML parsing in Vercel dev server
- Solution: Added
assetsInclude: ['**/*.html']to Vite config
- Solution: Added
- Issue: ES module compatibility
- Solution: Converted serverless functions to use ES module syntax
- Issue: Test environment setup
- Solution: Added proper ESM support and test utilities
- Monitor test coverage and maintain/improve coverage levels
- Add more edge case tests for API endpoints
- Set up component testing for frontend
- Implement API response caching
- Add integration tests for frontend-API interaction
- Consider adding end-to-end testing with Cypress or Playwright
- Start Vercel dev server:
vercel dev - Run tests:
npm run test:api - Check coverage:
npm run test:coverage - Frontend automatically proxies API requests to Vercel dev server
- Use browser dev tools to verify API requests and responses