-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix(jest-resolve-dependencies): resolve mocks as dependencies #10713
fix(jest-resolve-dependencies): resolve mocks as dependencies #10713
Conversation
Co-Authored-By: Simen Bekkhus <sbekkhus91@gmail.com>
…p/jest into brapifra/resolve-mock-dependencies
packages/jest-resolve-dependencies/src/__tests__/dependency_resolver.test.ts
Outdated
Show resolved
Hide resolved
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.
I'll defer to @jeysal here 👍
resolvedMockDependency = path.resolve(resolvedMockDependency); | ||
|
||
// make sure mock is in the correct directory | ||
if (dependencyMockDir === path.dirname(resolvedMockDependency)) { |
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.
Is there a test that fails if this acc.push
is unconditional?
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.
Yes! Both tests fail if this gets removed. Removing it would basically add an extra non-valid dependency to the list.
Just one question about a potentially missing test case (or maybe I missed how the existing tests would already cover it), other than that LGTM |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
This is the continuation of #8952, which solves #8907
Test plan
I've used the unit tests from the original PR. In one of them, I've added a new assertion to check that mocks of node modules are also included as dependencies.