use default cwd even if config contains a cwd property#7923
use default cwd even if config contains a cwd property#7923jeysal merged 1 commit intojestjs:masterfrom
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.
I don't follow - shouldn't options just override default options?
There was a problem hiding this comment.
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.
(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.
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? |
rubennorte
left a comment
There was a problem hiding this comment.
@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