-
-
Notifications
You must be signed in to change notification settings - Fork 688
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
base: master
Are you sure you want to change the base?
Conversation
|
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 |
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