-
-
Notifications
You must be signed in to change notification settings - Fork 757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor : src/setup/checkConnection/checkConnection from Jest to Vitest #2751 #2767
Refactor : src/setup/checkConnection/checkConnection from Jest to Vitest #2751 #2767
Conversation
WalkthroughThis pull request involves migrating the Changes
Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Our Pull Request Approval ProcessThanks for contributing! Testing Your CodeRemember, your PRs won't be reviewed until these criteria are met:
Our policies make our code better. ReviewersDo not assign reviewers. Our Queue Monitors will review your PR and assign them.
Reviewing Your CodeYour reviewer(s) will have the following roles:
CONTRIBUTING.mdRead our CONTRIBUTING.md file. Most importantly:
Other
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/setup/checkConnection/checkConnection.spec.ts (1)
Line range hint
5-22
: Use a dedicated setup for complex mock logic if needed.Defining
fetch
globally withvi.fn
works for now, but if mock complexity grows, consider using a dedicated setup module (e.g., a fixture,beforeAll
, or a dedicated mock file) to keep tests organized.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/setup/checkConnection/checkConnection.spec.ts
(3 hunks)
🔇 Additional comments (3)
src/setup/checkConnection/checkConnection.spec.ts (3)
2-3
: Everything looks good regarding the Vitest migration.
Switching from Jest to Vitest is correctly done here, retaining the same test logic. The vi.mock
usage for 'node-fetch' is properly handled.
25-25
: Appropriate usage of vi.clearAllMocks()
.
Clearing all mocks before each test run ensures no unexpected state carries over between tests. Good job!
29-29
: Console logging is effectively mocked.
Using vi.spyOn
for console logging is consistent and prevents cluttering test output. Verify other console methods (e.g., console.error
) if needed.
Also applies to: 42-42
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop-postgres #2767 +/- ##
=====================================================
+ Coverage 72.46% 87.17% +14.71%
=====================================================
Files 296 313 +17
Lines 7358 8204 +846
Branches 1606 1848 +242
=====================================================
+ Hits 5332 7152 +1820
+ Misses 1766 867 -899
+ Partials 260 185 -75 ☔ View full report in Codecov by Sentry. |
7025360
into
PalisadoesFoundation:develop-postgres
Refactored src/setup/checkConnection/checkConnection.test.ts to
src/setup/checkConnection/checkConnection.spec.ts
Issue: #2751: #2751
Changes Implemented:
Refactored the testing framework from Jest to Vitest in src/setup/checkConnection/checkConnection.test.ts.
Updated import statements, mocking methods, and assertions to align with Vitest conventions.
Verified compatibility with the existing codebase using Vitest.
From checkConnection.test.ts → checkConnection.spec.ts to follow the naming convention for Vitest.
Refactor:
src/setup/checkConnection/checkConnection.test.ts
from Jest to Vitest #2751Other information
I have read the previous refactor PR and tried to keep things as uniform as possible.
Please suggest any other changes if required.
Summary by CodeRabbit