refactor(language): Test/improve tests on languages middleware (#4980)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
* test(language): add some tests on the language-middleware * feat: remove unreachable code - detectFromQuery: c.req.query shouldn't throw and normalizeLanguage already has a try/catch that return undefined - detectFromCookie: getCookie shoundn't throw and normalizeLanguage already has a try/catch that return undefined * feat: remove unreachable code - language detector: remove redundant guards and fallback catches handled by detector validation and normalizeLanguage * feat: remove unreachable code - detectLanguage: detector shouldn't be undefined because options are validated before detection * feat: remove unreachable code - languageDetector: detectLanguage shouldn't throw because detector errors are already handled internally
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+101 added−33 removed
- tests:+91 added−0 removed
- other:+10 added−33 removed