Add comprehensive tests for i18n routes and fix route ordering

- Add 19 integration tests for i18n API routes with 100% coverage
- Fix Express route ordering: specific routes (/detect) before parameterized routes (/:locale)
- Test all endpoints: locale translations, available locales, locale detection
- Test error cases: unsupported locales, missing translations, malformed headers
- Test HTTP caching headers and content-type validation
- Include i18n routes in coverage collection (was previously excluded)

Coverage improvement: 147 tests total (+19), 79.9% statements (+1.2%)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude Code 2025-07-07 20:50:34 -04:00
parent a6f4830ab8
commit a537072d3d
3 changed files with 353 additions and 32 deletions

View file

@ -17,8 +17,7 @@ module.exports = {
'!src/server.ts', // Skip main server as it's integration-focused
'!src/frontend/**/*', // Skip frontend files (use DOM types, tested separately)
'!src/i18n/**/*', // Skip i18n files (utility functions, tested separately)
'!src/services/MapImageService.ts', // Skip map service (requires external API, tested separately)
'!src/routes/i18n.ts' // Skip i18n routes (utility endpoints, tested separately)
'!src/services/MapImageService.ts' // Skip map service (requires external API, tested separately)
],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov', 'html'],