Skip to content

Conversation

@lposen
Copy link
Contributor

@lposen lposen commented Sep 30, 2025

🔹 JIRA Ticket(s) if any

✏️ Description

Improved test coverage of Iterable.ts

@github-actions
Copy link

github-actions bot commented Sep 30, 2025

Lines Statements Branches Functions
Coverage: 45%
45.33% (214/472) 20.67% (37/179) 37.41% (58/155)

@qltysh
Copy link

qltysh bot commented Sep 30, 2025

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
Path File Coverage Δ Indirect
src/core/classes/Iterable.ts 22.5
src/core/classes/IterableAuthResponse.ts 100.0
src/inApp/classes/IterableInAppMessage.ts 12.1
🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

This is from Qlty Cloud, the successor to Code Climate Quality. Learn more.

@qltysh
Copy link

qltysh bot commented Sep 30, 2025

All good ✅
This is from Qlty Cloud, the successor to Code Climate Quality. Learn more.

@lposen lposen requested a review from Copilot October 6, 2025 21:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ts to src/core/classes/Iterable.test.ts with 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.

Comment on lines 954 to 955
// Use unref() to prevent the timeout from keeping the process alive
timeoutId.unref();
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
// 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.

Copilot uses AI. Check for mistakes.
Comment on lines +1019 to +1020
// Use unref() to prevent the timeout from keeping the process alive
timeoutId.unref();
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
// Use unref() to prevent the timeout from keeping the process alive
timeoutId.unref();
// In React Native, unref() is not available and not needed

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it good to ignore?

Copy link
Member

@Ayyanchira Ayyanchira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines 4234 to 4249
"@react-navigation/native@npm:^6.0.8":
version: 6.1.18
resolution: "@react-navigation/native@npm:6.1.18"
dependencies:
"@react-navigation/core": ^6.4.17
escape-string-regexp: ^4.0.0
fast-deep-equal: ^3.1.3
nanoid: ^3.1.23
peerDependencies:
react: "*"
react-native: "*"
checksum: 82aeea67723f5dc41403e1c260f04942696f6cde95e30629c383521c3837d18d2d5c21bd78f0ade50beb81ac5edca2d7d38980dcd3a79e3acc86f45d0c09a4b8
languageName: node
linkType: hard

"@react-navigation/native@npm:^7.1.14":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do both of them same name with different version stay?

Comment on lines +1019 to +1020
// Use unref() to prevent the timeout from keeping the process alive
timeoutId.unref();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it good to ignore?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Impressive test suite with clear comments to follow along

@lposen lposen merged commit 763709c into master Oct 8, 2025
13 checks passed
@lposen lposen deleted the feature/MOB-12158-improve-iterable-ts-test-coverage branch October 8, 2025 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants