Skip to content

test: add test case for mocking invalid package and module#9617

Merged
sheremet-va merged 16 commits intovitest-dev:mainfrom
hi-ogawa:02-09-fix_allow_mocking_invalid_package
Feb 10, 2026
Merged

test: add test case for mocking invalid package and module#9617
sheremet-va merged 16 commits intovitest-dev:mainfrom
hi-ogawa:02-09-fix_allow_mocking_invalid_package

Conversation

@hi-ogawa
Copy link
Copy Markdown
Collaborator

@hi-ogawa hi-ogawa commented Feb 9, 2026

Description

I added a test case to verify #9257 is fixed on Vite 8.

I also added a test case to show manual mocking still transforms the original module. I dug a bit and I'm not sure yet if I can fix it yet or intended behavior, so I just added a test for this. Will create a separate issue for this and discuss.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.
  • Please check Allow edits by maintainers to make review process faster. Note that this option is not available for repositories that are owned by Github organizations.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@netlify
Copy link
Copy Markdown

netlify bot commented Feb 9, 2026

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit c8614f6
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/698ab8a06d0cc5000845dc96
😎 Deploy Preview https://deploy-preview-9617--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hi-ogawa hi-ogawa changed the title fix: allow mocking invalid package test: add test case for mocking invalid package and module Feb 10, 2026
@hi-ogawa hi-ogawa marked this pull request as ready for review February 10, 2026 05:00
@sheremet-va sheremet-va merged commit 4a28a9d into vitest-dev:main Feb 10, 2026
15 of 16 checks passed
@hi-ogawa hi-ogawa deleted the 02-09-fix_allow_mocking_invalid_package branch February 10, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vitest 4 can no longer have projects with import ... 'bun'

2 participants