You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've addressed the final PR feedback and ensured test robustness.
This commit incorporates the final round of review feedback from PR #864, focusing on minor code optimizations and ensuring the comprehensive refactoring of tests in `src/utils/__tests__/model-name-convert.test.mjs` is effective and clean.
Key changes I've addressed in this commit:
- **`src/utils/is-mobile.mjs` Optimization:**
- I removed a redundant `check = false;` assignment within an early return path, as suggested by CodeRabbit AI, for cleaner code.
- **Verification of `model-name-convert.test.mjs` Refactoring:**
- I confirmed that all tests (70 in this suite, 157 total) now pass after extensive refactoring using `jest.isolateModulesAsync` and `jest.doMock` with dynamic imports. This ensures proper test isolation for scenarios requiring modified mock states, addressing all your previous concerns about shared mock modification and the use of the `delete` operator for cleanup.
- The persistent syntax errors I encountered in previous steps due to issues with file markers have been resolved, allowing successful execution and validation of these tests.
- **Confirmation of Previous Fixes:**
- I ensured that `parseIntWithClamp` function signature and its call sites remain consistent, as previously corrected.
- I ensured ESLint configuration correctly handles Jest globals for all test files.
- I ensured `parseInt` uses radix 10 in `parse-int-with-clamp.mjs`.
- I ensured the comment for the inverted question mark in `ends-with-question-mark.mjs` is clear.
All linting checks (`npm run lint`) pass.
All 157 unit tests in 9 suites pass (`npm test`).
Code coverage for `src/utils/model-name-convert.mjs` remains excellent (Statements: 100%, Branches: 98.63%, Functions: 100%, Lines: 100%), and other tested utility files also maintain high coverage.
This series of commits has substantially improved the test coverage, code quality, and robustness of the utility functions and their tests.
0 commit comments