-
-
Notifications
You must be signed in to change notification settings - Fork 696
Migrate from Mocha to Vitest #2789
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
⚠️ No Changeset found
Latest commit: 85cfbea
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
ec06a3e
to
97312e7
Compare
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.
While searching for mocha
in the repo (https://github.com/search?q=repo%3Avuejs%2Feslint-plugin-vue%20mocha&type=code), I found two more occurrences that should probably be adapted, or just removed:
- tests/.eslintrc.json
- .vscode/launch.json
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.
Looks good to me 🙂
Thank you! 🚀
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.
Pull Request Overview
Migrates the test framework from Mocha to Vitest to improve test execution performance and update related configurations.
- Added a
vitest.config.ts
with test and coverage settings - Updated integration tests to use Vitest-compatible hooks and
cwd
options instead ofprocess.chdir()
- Swapped out Mocha scripts, dependencies, and ESLint globals for Vitest equivalents; removed old VSCode launch config
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
vitest.config.ts | Introduce Vitest test and coverage configuration |
tests/integrations/flat-config.js | Use beforeAll and cwd option for flat-config integration test |
tests/integrations/eslint-plugin-import.js | Use beforeAll and cwd option for plugin-import integration test |
tests/.eslintrc.json | Remove Mocha-specific ESLint config |
package.json | Update scripts and dependencies from Mocha/nyc to Vitest |
eslint.config.mjs | Switch ESLint globals from Mocha to Vitest |
.vscode/launch.json | Remove outdated Mocha debug configuration |
Comments suppressed due to low confidence (1)
@waynzh @FloEdelmann
Thank you for reviewing my PR 🚀
Your review helped me to create a better one 💯
@ota-meshi
This PR is ready for review.
When you have time, I’d appreciate your feedback 😀
I’m happy to adjust anything you spot 🚀
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.
Awesome! Thank you!
(Sorry for the late reply. I've been very busy lately 😓)
@ota-meshi
Thank you for reviewing!
Sorry for the late reply. I've been very busy lately 😓
No worries at all—I hope things ease up soon 🙂
If there’s anything I can help with, just let me know 🚀
Uh oh!
There was an error while loading. Please reload this page.
Summary
Migrates the test framework from Mocha to Vitest to significantly improve test execution performance.
Closes #2787
Changes Made
060f779 - Initial Migration (Automated)
3b667b0 - Manual Configuration & Integration Fixes
vitest.config.ts
with comprehensive test configuration:process.chdir()
usage withcwd
option incp.execSync()
callstests/integrations/eslint-plugin-import.js
tests/integrations/flat-config.js
before/after
hooks withbeforeAll
ec06a3e - Global API Configuration
eslint.config.mjs
to usevitest
globals instead ofmocha
Migration Details
Test Plan