fix: break dependency cycle in jest-cli#7707
Conversation
|
|
||
| const path = require('path'); | ||
| const customImportResolver = path.resolve('./eslintImportResolver'); | ||
| const customImportResolver = require.resolve('./eslintImportResolver'); |
There was a problem hiding this comment.
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.
/cc @segrey (I don't have time to open up a proper bug report on youtrack, sorry!)
There was a problem hiding this comment.
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.
Sorry for being slow. Thanks, reproduced (https://youtrack.jetbrains.com/issue/WEB-37116).
/cc @undeadcat
jeysal
left a comment
There was a problem hiding this comment.
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
|
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