-
-
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
Refactored src/utils/convertToBase64.test.ts from Jest to Vitest #2777
Conversation
WalkthroughThis pull request focuses on refactoring the Changes
Assessment against linked issues
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.
Congratulations on making your first PR! 🎊 If you haven't already, check out our Contributing Guidelines and PR Reporting Guidelines to ensure that you are following our guidelines for contributing and creating PR.
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/utils/convertToBase64.spec.ts (1)
20-20
: Mocking FileReader is properly implemented.Using
vi.spyOn(global, 'FileReader')
ensures the effect is confined to this test. If you need to mockFileReader
in multiple tests, consider a common setup in abeforeEach
block for improved maintainability.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (1)
src/utils/convertToBase64.spec.ts
(3 hunks)
🔇 Additional comments (2)
src/utils/convertToBase64.spec.ts (2)
1-1
: Great job replacing Jest imports with Vitest imports.
The updated imports from vitest
look correct. Ensure that no Jest-specific imports or methods remain anywhere in the codebase to avoid confusion or potential conflicts.
33-33
: Good cleanup practice.
Restoring the mocked FileReader
helps prevent test pollution, ensuring that subsequent tests remain unaffected.
This PR needs to be closed. The source and target PR branches are the same. This means that our reviewers will not be able to checkout the changes and test on their systems using this methodology which will cause a rejection error: Please follow these steps:
NOTE: We are also only accepting changes based on the Closing |
What kind of change does this PR introduce?
Refactoring
Issue Number:
Fixes #2759
Did you add tests for your changes?
NO
Snapshots/Videos:
Modified the file and ran the
npm run test:vitest
command to check and it was cleared:Also ran the specific file vitest
npx vitest run .\src\utils\convertToBase64.spec.ts
:And ensured the linting and formatting:
If relevant, did you update the documentation?
Not yet
Summary
Does this PR introduce a breaking change?
No... it simply converts one test suite framework to other.
Other information
Have checked all the points in the Acceptance Criteria that was asked in the Issue:
Have you read the contributing guide?
Yes
Summary by CodeRabbit
convertToBase64
functionality.