-
-
Notifications
You must be signed in to change notification settings - Fork 88
feat: replace jest with vitest #154
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
Conversation
# Conflicts: # resources/js/yarn.lock
This is the best I can do right now 😅 If you have any suggestion, feel free to edit this PR. Updated my first comment. |
Should we get these conflicts resolved and merge this in too? |
Yes, we should. I now strongly believe this is not the right way to test electron features/api. They are still a bit useful in this state, but we should rely more on e2e in the future. |
I can merge conflict later this afternoon. |
# Conflicts: # resources/js/electron-plugin/tests/endpoints/dialog.test.ts # resources/js/package-lock.json # resources/js/package.json # resources/js/yarn.lock
Ready! |
I wonder why the plugin build is failing now here... maybe it's missing the GitHub token in that action? |
Yeah, I saw, but it's unrelated to my code, the build works, It's committing on my branch that doesn't. I think it's because this branch is still in my old fork of the project (srwiez/fork-nativephp-electron) So, I suppose the workflow won't work on our contributors' branches. Anyway, it seems like this workflow still needs some love. |
Yep that's it |
Replacing Jest with Vitest 🎉
Works out of the box with ESM and has fewer dependencies. And, error messages are much more clear.
vitest
instead of.jest
electron
module usingvitest
and a new test file to verify the mocking of theelectron
module usingvitest
. (resources/js/electron-plugin/tests/mocking.test.ts
)jest
configuration files and dependencies sincevitest
supports ESM out of the box.vite
,electron-vite
and someeslint
andstylelint
pluginsBut⚠️ :
endpoints/clipboard.test.ts
,endpoints/dialog.test.ts
,endpoints/window.test.ts
).