-
-
Notifications
You must be signed in to change notification settings - Fork 755
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
Feature/jest to vitest migration #6605
base: main
Are you sure you want to change the base?
Feature/jest to vitest migration #6605
Conversation
✅ Deploy Preview for plone-components canceled.
|
I’ve created this draft PR to get feedback on my current progress for this issue. Here’s what I’ve completed so far and what remains to be done: Remaining Work: Looking forward to your feedback! |
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.
I added some preliminary comments, please take a look at them. I know it's a WIP still, but I hope they help.
I haven't gone through all the changes, but the few I went look good.
It's an humongous work, so thank you for taking care of it!
You already changed the scripts commands, so it should work, CI points at them:
pnpm --filter @plone/volto test
CI is RED because you need to update the lockfile (pnpm install
).
|
||
jest.mock('../Form/Form', () => jest.fn(() => <div className="Form" />)); | ||
vi.mock('../Form/Form', () => ({ |
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.
We should include some docs about how mocks work, and the recommended way in usual cases, like this one.
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.
I'll add documentation about how mocks work and the recommended approach for common cases like this. That will make it easier for others to follow.
@sneridagh Thank you for the helpful review! I’ll implement the suggestions. |
a617af1
to
ac8055c
Compare
Hey @sneridagh, I’m in the final phase of this work and need your help with an issue I’ve been stuck on for the past few days. In this file https://github.com/plone/volto/blob/main/packages/volto/__tests__/create-addons-loader.test.js, perticuarly in Could you help me out with this? |
7bc629f
to
f9c3d3c
Compare
Only two files are remaining to migrate to vitest |
@Abhishek-17h This is amazing! PD: I don't know if using |
@sneridagh Thanks for your suggestion! Jiti worked perfectly and solved the problem that had me stuck for a week. |
fd6396b
to
c16b21e
Compare
@sneridagh Code is ready for review! All tests are passing successfully with Vitest, including the previously mentioned ones. The documentation is still pending, but it’s not a significant task. While the review is in progress, I will work on completing the documentation, as the review process will take considerable time. |
c16b21e
to
b61644b
Compare
@Abhishek-17h thank you for this massive effort. Two things:
|
@stevepiercy I will resolve merge conflicts and I will reach out if I need any assistance for documentation |
If your pull request closes an open issue, include the exact text below, immediately followed by the issue number. When your pull request gets merged, then that issue will close automatically.
Closes #6326