-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
fix: break dependency cycle in jest-cli #7707
Conversation
.eslintrc.js
Outdated
@@ -5,8 +5,7 @@ | |||
* LICENSE file in the root directory of this source tree. | |||
*/ | |||
|
|||
const path = require('path'); | |||
const customImportResolver = path.resolve('./eslintImportResolver'); | |||
const customImportResolver = require.resolve('./eslintImportResolver'); |
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.
new beta version of intellij (2019.1) tries to be too clever for its own good and failed the resolution here. This fixes it, I snuck it in 😀
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.
/cc @segrey (I don't have time to open up a proper bug report on youtrack, sorry!)
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.
Actually any path resolution that resolves modules should go through require.resolve
(to include the extension and work with PnP :D)
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.
Sorry for being slow. Thanks, reproduced (https://youtrack.jetbrains.com/issue/WEB-37116).
/cc @undeadcat
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.
👍
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.
Would it be possible for us to e2e test programmatic usage?
It may not be officially supported but it's apparently a somewhat common thing to do and once we have a public API, we could just adapt the existing test.
The real programmatic api will look nothing like this, but it'd be great if you wrote a simple sanity check :) |
Will do 👍 |
@SimenB you can pull the e2e test from `jeysal/jest:correct-jest-cli-programmatic" :) |
Thanks @jeysal! |
Codecov Report
@@ Coverage Diff @@
## master #7707 +/- ##
==========================================
- Coverage 68.28% 68.27% -0.02%
==========================================
Files 251 252 +1
Lines 9682 9682
Branches 5 6 +1
==========================================
- Hits 6611 6610 -1
- Misses 3069 3070 +1
Partials 2 2
Continue to review full report at Codecov.
|
a126260
to
42d3797
Compare
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.
Looks good!
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
Fixes #7704
Test plan
I tested it 😀
node -p "require('jest').run(process.argv.slice(2))"
before and after this change