Code Review Bench PR #30376 - test: unify i18next mocks into centralized helpers#7
Conversation
Consolidate scattered i18next mock implementations across test files into a single source of truth. This reduces duplication and ensures consistent mock behavior. - Create test/i18n-mock.ts with reusable factory functions - Update vitest.setup.ts to use the centralized helpers - Remove redundant mock definitions from 8 test files - Update testing.md documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…eateReactI18nextMock` and detail global mock provisions.
Code Review 👍 Approved with suggestions 0 resolved / 2 findingsClean test infrastructure refactoring that correctly consolidates duplicated i18next mocks into reusable factories. Two minor documentation/fidelity improvements suggested. 💡 Bug: JSDoc describes lookup order opposite to actual codeThe JSDoc on line 8 says "Checks translations[key] first, then translations[ns.key]" but the implementation on lines 16-21 checks Impact: Low — just a documentation mismatch, but could confuse developers when they provide translations with both bare keys and namespaced keys. Suggested fix💡 Edge Case:
|
| Auto-apply | Compact |
|
|
Was this helpful? React with 👍 / 👎 | Gitar
Code Review Bench PR langgenius#30376 - test: unify i18next mocks into centralized helpers
Benchmark PR for Gitar evaluation
Original PR: agentic-review-benchmarks#7
test: unify i18next mocks into centralized helpers
Summary by Gitar
web/test/i18n-mock.tsfactory functionscreateTFunction,createUseTranslationMock,createTransMock, andcreateReactI18nextMockwith namespace-aware translation resolutionweb/testing/testing.mdand test templates to recommend centralized mock usageThis will update automatically on new commits.