Set the start dir of looking for tsconfig to process.cwd()#348
Set the start dir of looking for tsconfig to process.cwd()#348kulshekhar merged 4 commits intokulshekhar:masterfrom
Conversation
|
The failed test is:
No idea why... should i just change the expected value? |
| const grandparent = path.resolve(__dirname, '..', '..'); | ||
| if (grandparent.endsWith('/node_modules')) { | ||
| return path.resolve(grandparent, '..'); | ||
| return process.cwd(); |
There was a problem hiding this comment.
If we're using process.cwd(), there's no need for the getStartDir function at all. process.cwd() is synonymous with . so the conditions in the function don't make any sense.
It would be better to remove this function and replace all calls to getStartDir with process.cwd(). Alternatively, just replace the contents of getStartDir with
return process.cwd()
There was a problem hiding this comment.
it seems like that to me but,
When i change the function to just return process.cwd()
more test fails
I assume it because absolute and relative paths are handled differently in some point in the code.
If its important i can try to figure what's going on.
There was a problem hiding this comment.
You're right. This change is good in its current form.
I'm not sure what's happening because this is failing only for Node v8 and just on Linux. I'll have to take a closer look. I'll also have to take a closer look at how this affects the fix for lerna projects ( #342 ) |
|
@Bnaya just some minor things
|
|
What about the failing test? |
|
I've pushed a change for that |
fe4333a to
c19b7e1
Compare
|
Done, |
|
I've rerun the test on appveyor and it looks like it'll pass now. I have no idea what happened. |
|
This has been published. Thanks @Bnaya :) |
|
Thank you for this great tool!! |
Mimic jest behaviour to find
package.json(and his config inside it)See
https://github.com/facebook/jest/blob/d62a7e0edfec556758e1c0e23158e4ce4ac84e91/packages/jest-runtime/src/cli/index.js#L60-L68
https://github.com/facebook/jest/blob/e04e45102b3ebe486462d45db656f9b47f0e70e1/packages/jest-config/src/index.js#L18-L26
resolved #347