Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
2nofa11 wants to merge8 commits intovuejs:master
base:master
Choose a base branch
Loading
from2nofa11:chore/migrate-to-vitest

Conversation

2nofa11
Copy link
Contributor

@2nofa112nofa11 commentedJul 12, 2025
edited
Loading

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

  • Addedvitest.config.ts with comprehensive test configuration:
    • Coverage provider set to v8
    • Configured include/exclude patterns
  • Fixed integration tests to address Vitest worker limitations (vitest#1436):
    • Replacedprocess.chdir() usage withcwd option incp.execSync() calls
    • Updatedtests/integrations/eslint-plugin-import.js
    • Updatedtests/integrations/flat-config.js
    • Replacedbefore/after hooks withbeforeAll

ec06a3e - Global API Configuration

  • Updatedeslint.config.mjs to usevitest globals instead ofmocha

Migration Details

  • Test Coverage: All 11,059 tests pass without modification
  • Compatibility: Maintains ESLint RuleTester compatibility
  • Performance: 67% faster execution (74s → 24s)
  • Configuration: Comprehensive vitest.config.ts with:
    • V8 coverage provider
    • HTML and LCOV reporting
    • Proper include/exclude patterns
    • Global API configuration

Test Plan

  • All existing tests pass (11,059 tests)
  • Integration tests work correctly
  • Coverage reporting functional
  • Performance improvement verified
  • CI/CD pipeline validation needed

@changeset-botchangeset-bot
Copy link

changeset-botbot commentedJul 12, 2025
edited
Loading

⚠️ 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

@2nofa112nofa11force-pushed thechore/migrate-to-vitest branch fromec06a3e to97312e7CompareJuly 12, 2025 09:30
@2nofa112nofa11 marked this pull request as ready for reviewJuly 12, 2025 10:51
Copy link
Member

@FloEdelmannFloEdelmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

While searching formocha 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

2nofa11 reacted with thumbs up emoji
Copy link
Member

@FloEdelmannFloEdelmann left a 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! 🚀

Copy link

@CopilotCopilotAI left a 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 avitest.config.ts with test and coverage settings
  • Updated integration tests to use Vitest-compatible hooks andcwd 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
FileDescription
vitest.config.tsIntroduce Vitest test and coverage configuration
tests/integrations/flat-config.jsUsebeforeAll andcwd option for flat-config integration test
tests/integrations/eslint-plugin-import.jsUsebeforeAll andcwd option for plugin-import integration test
tests/.eslintrc.jsonRemove Mocha-specific ESLint config
package.jsonUpdate scripts and dependencies from Mocha/nyc to Vitest
eslint.config.mjsSwitch ESLint globals from Mocha to Vitest
.vscode/launch.jsonRemove outdated Mocha debug configuration
Comments suppressed due to low confidence (1)

@2nofa11
Copy link
ContributorAuthor

@waynzh@FloEdelmann
Thank you for reviewing my PR 🚀
Your review helped me to create a better one 💯

FloEdelmann reacted with thumbs up emojiFloEdelmann reacted with rocket emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@FloEdelmannFloEdelmannFloEdelmann approved these changes

Copilot code reviewCopilotCopilot left review comments

@waynzhwaynzhwaynzh approved these changes

@ota-meshiota-meshiAwaiting requested review from ota-meshi

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Migrate to Vitest
3 participants
@2nofa11@FloEdelmann@waynzh

[8]ページ先頭

©2009-2025 Movatter.jp