[MOB-12158] improve-iterable-ts-test-coverage#705
Conversation
|
Diff Coverage: The code coverage on the diff in this pull request is 100.0%. Total Coverage: This PR will increase coverage by 6.76%. File Coverage Changes
🛟 Help
This is from Qlty Cloud, the successor to Code Climate Quality. Learn more. |
|
All good ✅ |
There was a problem hiding this comment.
Pull Request Overview
This PR improves test coverage for the Iterable.ts file by relocating comprehensive test files and updating package dependencies. The changes aim to enhance code quality and maintainability of the Iterable React Native SDK.
- Relocates test file from
src/__tests__/Iterable.test.tstosrc/core/classes/Iterable.test.tswith significant expansion of test cases - Updates package dependencies including React Navigation, Testing Library, and various React Native packages
- Adds timeout handling improvements to prevent process hanging in production code
Reviewed Changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/core/classes/Iterable.test.ts |
New comprehensive test file with 915 lines covering all major Iterable functionality |
src/__tests__/Iterable.test.ts |
Original test file removed (433 lines deleted) |
src/core/classes/Iterable.ts |
Added unref() calls to timeouts to prevent process hanging |
src/__mocks__/MockRNIterableAPI.ts |
Enhanced mock with additional methods and resolved promises |
package.json |
Updated dependencies and added test watch script |
tsdoc.json |
Simplified configuration by removing TypeDoc plugin extensions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/core/classes/Iterable.ts
Outdated
| // Use unref() to prevent the timeout from keeping the process alive | ||
| timeoutId.unref(); |
There was a problem hiding this comment.
The unref() method is a Node.js-specific API that doesn't exist in React Native environments. This will cause a runtime error when the code runs on mobile devices.
| // Use unref() to prevent the timeout from keeping the process alive | |
| timeoutId.unref(); | |
| // In Node.js, you might use timeoutId.unref() to prevent the timeout from keeping the process alive. | |
| // In React Native, unref() is not available and not needed. |
| // Use unref() to prevent the timeout from keeping the process alive | ||
| timeoutId.unref(); |
There was a problem hiding this comment.
The unref() method is a Node.js-specific API that doesn't exist in React Native environments. This will cause a runtime error when the code runs on mobile devices.
| // Use unref() to prevent the timeout from keeping the process alive | |
| timeoutId.unref(); | |
| // In React Native, unref() is not available and not needed |
| @@ -4193,6 +4246,22 @@ __metadata: | |||
| languageName: node | |||
| linkType: hard | |||
|
|
|||
| "@react-navigation/native@npm:^7.1.14": | |||
There was a problem hiding this comment.
Do both of them same name with different version stay?
| // Use unref() to prevent the timeout from keeping the process alive | ||
| timeoutId.unref(); |
There was a problem hiding this comment.
Impressive test suite with clear comments to follow along
🔹 JIRA Ticket(s) if any
✏️ Description
Improved test coverage of Iterable.ts