Skip to content

fix(mocker): keep importOriginal() exports on parallel imports - #12161

Merged
sheremet-va merged 2 commits into
mainfrom
fix/mock-placeholder-node
Dec 1, 2026
Merged

sheremet-va merged 2 commits into
mainfrom
fix/mock-placeholder-node

Conversation

@sheremet-va

@sheremet-va sheremet-va commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

The placeholder of a manual or redirect mock shared one module node with the original module, and each fetch replaces the meta of its node. A plain import of the mocked module could replace the original meta after importOriginal() fetched it, so the original evaluated as an empty module. The placeholder now has its own node, and the paths that load the original go through cachedRequest(..., true), so isWaitingForFactory still sees factory cycles.

Fixes #12006
Closes #12007

@netlify

netlify Bot commented Dec 1, 2026

Copy link
Copy Markdown

✅ Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit 52437c3
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6b0eb7159e8a6c42faf31de3
😎 Deploy Preview https://deploy-preview-12161--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@flakiness-io

flakiness-io Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Test Results Summary

This comment shows the latest test results for this pull request.

Commit Status Test Results CI Runs
967e71a ✅ Passed 33670 passed · 234 flaky · 1279 skipped 30 runs
⚠️ 234 flaky

⚠️ win 10.0.26100 · threads test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ Ubuntu 26.04 · vmThreads test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ Ubuntu 26.04 · threads test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ Ubuntu 26.04 · threads test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ Ubuntu 26.04 · vmThreads test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ Ubuntu 26.04 · forks test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ Ubuntu 26.04 · forks test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ win 10.0.26100 · vmThreads test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ win 10.0.26100 · forks test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ win 10.0.26100 · threads test/unit/test/retry.test.ts:61 › describe object add(1, 1) › returned value not be less than 2
…and 224 more

View full report

ℹ️ About Flakiness.io in GitHub

Your team has set up Flakiness.io pull request comments. This comment is updated when

  • The first test results arrive for this pull request
  • A later run reports more results for the same commit
  • A new commit is pushed and tested

Flakiness.io rewrites the comment in place, so it always reflects the most recently tested commit.

@sheremet-va
sheremet-va merged commit 849c733 into main Dec 1, 2026
30 checks passed
@sheremet-va
sheremet-va deleted the fix/mock-placeholder-node branch December 1, 2026 13:09
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.

importOriginal() can return an empty module when the mocked module is imported concurrently

1 participant