-
-
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
use default cwd even if config contains a cwd property #7923
Conversation
// cwd is an exception, it must not appear in InitialOptions | ||
const {cwd: _cwd, ...defaults} = Defaults; | ||
|
||
normalize({...defaults, rootDir: '/root'}, {}); |
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 don't follow - shouldn't options just override default options?
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.
As I understand it, cwd
is not a supported option for users to specify in the config. I mentioned in the issue that it does not appear in the docs or in InitialOptions
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.
@rubennorte you added it in #7146 - thoughts?
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 also think it's right that it is not something that can be explicitly set, that should only be the case for rootDir
)
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.
Either way, cwd
becoming undefined
if it is explicitly set is definitely not expected behavior 😅
ef17b38
to
2da5f57
Compare
Updated to do this in a much cleaner way, don't know what I was thinking yesterday ^^ |
2da5f57
to
529d73d
Compare
Codecov Report
@@ Coverage Diff @@
## master #7923 +/- ##
=======================================
Coverage 62.31% 62.31%
=======================================
Files 265 265
Lines 10534 10534
Branches 2557 2556 -1
=======================================
Hits 6564 6564
Misses 3387 3387
Partials 583 583
Continue to review full report at Codecov.
|
@Aghassi I think we're just waiting for @rubennorte who originally added |
@jeysal I'm actually never setting it explicitly. EDIT: I lied it doesn't. |
@Aghassi the reproduction repo you provided (https://github.com/Aghassi/oclif-jest-demo-failure/blob/master/jest.config.js) does set it though? And when I checked out that repo a week ago, the error went away after removing |
@jeysal Sorry, I was trying it on an internal repo and as far as I can tell we never set it. I was able to validate and realized I had deleted |
Okay. I hope your internal repo doesn't surface a whole different issue than the reproduction then 😬 |
@jeysal For now, we are downgrading until the typescript changes are ironed out. Since we support larger systems, and I can't seem to figure out why beyond deleting |
@rubennorte any chance you can chime in here? Ideally I’d like to be able to update to the latest jest, but am still blocked in part due to this. |
@SimenB do we absolutely need Ruben's input on this? |
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.
@jeysal and @Aghassi sorry for the late reply, I've been a bit busy and some things starts to stack up.
This looks good. As @jeysal said, my main reason to add this change was to have it in jest-config and I see that allowing it in userland was a bad side-effect I wasn't counting on.
Thanks for the fix!
Rebased (manually) |
529d73d
to
fdb20cd
Compare
fdb20cd
to
cff4b4a
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 #7857, check that issue for details
Test plan