-
-
Notifications
You must be signed in to change notification settings - Fork 756
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/components/AddOn/support/services/Plugin.helper.test.ts from Jest to Vitest #2740
Refactor: src/components/AddOn/support/services/Plugin.helper.test.ts from Jest to Vitest #2740
Conversation
WalkthroughThis pull request focuses on refactoring the Changes
Assessment against linked issues
Possibly related issues
Possibly related PRs
Suggested labels
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 (3)
src/components/AddOn/support/services/Plugin.helper.spec.ts (3)
17-17
: Duplicate method assertion detected.Notice that there's a duplicate line: “expect(pluginHelper).toHaveProperty('generateLinks');” repeated twice. This is redundant. Removing the duplicate line will tidy the test.
it('Class should contain the required method definitions', () => { const pluginHelper = new PluginHelper(); expect(pluginHelper).toHaveProperty('fetchStore'); expect(pluginHelper).toHaveProperty('fetchInstalled'); expect(pluginHelper).toHaveProperty('generateLinks'); - expect(pluginHelper).toHaveProperty('generateLinks'); });
44-46
: Ensure consistent spy restoration.While the spy is restored at the end of the test, consider moving the spy setup/restoration to a shared beforeEach/afterEach block for consistency across multiple tests. This can help avoid accidental cross-test interference.
62-66
: Mock usage repeated across tests.Similar to the previous test, consider using a shared beforeEach/afterEach approach to prevent duplication and ensure consistent mocking behavior across tests.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/components/AddOn/support/services/Plugin.helper.spec.ts
(3 hunks)
🔇 Additional comments (3)
src/components/AddOn/support/services/Plugin.helper.spec.ts (3)
2-2
: Good use of Vitest import.
The direct import of "vi" from "vitest" is correct for mocking functionalities in Vitest. Ensure that all Jest references are replaced throughout the file.
4-14
: Documentation block looks clear.
These descriptive comments offer a clear summary of the test coverage in this file. No issues found.
24-24
: Generating links test looks accurate.
The test correctly checks the generated array against the expected object. If you would like to expand test coverage, consider verifying array length or testing multiple inputs.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop-postgres #2740 +/- ##
=====================================================
+ Coverage 75.56% 87.08% +11.52%
=====================================================
Files 295 312 +17
Lines 7289 8148 +859
Branches 1593 1784 +191
=====================================================
+ Hits 5508 7096 +1588
+ Misses 1518 875 -643
+ Partials 263 177 -86 ☔ View full report in Codecov by Sentry. |
2d7b26f
into
PalisadoesFoundation:develop-postgres
What kind of change does this PR introduce?
PluginHelper component tests migrated from jest to vitest.
Issue Number:
Fixes #2477
Did you add tests for your changes?
yes
Snapshots/Videos:
Summary by CodeRabbit