-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: manual and redirect mock shouldn't load or transform original module
#9774
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
Changes from all commits
9cc0b8e
71fbf91
d4c4de5
919b4c2
1aedd3b
b621937
fc50d52
1e21b99
158c1e6
caf3289
1099aec
42539a0
4a8fb50
bba414c
864f2c5
21ab1ac
bc5a94f
c4e8935
0efc6b2
1509b55
d7b0216
835d14b
b31de20
50d59c3
0dc1876
b9bdb25
9a9523e
90e0779
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -112,7 +112,7 @@ export function startVitestModuleRunner(options: ContextModuleRunnerOptions): Vi | |
| } | ||
|
|
||
| if (!isImportActual) { | ||
| const resolvedMock = moduleRunner.mocker.getDependencyMock(rawId) | ||
| const resolvedMock = moduleRunner.mocker.getDependencyMockByUrl(id) | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| if (resolvedMock?.type === 'manual' || resolvedMock?.type === 'redirect') { | ||
| return { | ||
| code: '', | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
This is added to support existing use cases where "import original module" fallback was happening magically. As the previous PR #9772 consolidated "import original module" to be only possible through
_vitest_originalquery, this adjustment became necessary.