-
Notifications
You must be signed in to change notification settings - Fork 294
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
Add usage of shell when gathering Jest settings #340
Conversation
Pull Request Test Coverage Report for Build 406
💛 - Coveralls |
constructor(parser?: any, customMatchers?: Array<string>) | ||
getMetadata(filepath: string): Array<SnapshotMetadata> | ||
} | ||
} |
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.
do we now ship this with jest-editor? if so -cooool
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.
yes, this file one is no longer needed and is removed in my upcoming PR
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 already previously a TypeScript definition within jest-editor-support, but it was out of sync.
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.
typescript recommends to keep the type file close to the source package, therefore I think it is best to treat the typings in jest-editor-supports
as the official types. IMHO, we should refrain from having a local copy here... in other words, we should add changes to jest-editor-supports
instead.
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.
For this PR I had to update the jest-editor-support
dependency, whoose recent versions contain already up-to-date typings, which is why I removed the local copy already with this PR.
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 see, great, we are doing the same thing then.
Do you think with #332, we still need the shell option for windows?
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.
#332 and #324 just modify the default values. At the moment one still has to manually add the .cmd
extension on Windows systems if one edits pathToJest
.
I still prefer spawning the processes in a shell (at least on Windows) instead, such that we and the users don't have to care about the different extensions (and the same settings work across all plattforms).
Good to go IMO, I don't mind about a tiny bit of code coverage changing. |
@orta you are quick today 😉 can we also hold off merging for this PR, it is not clear to me if we still need the shell command after #332 has added logic for windows... and I vaguely remember there is open discussion on using shell commands... in short, I would like to request we discuss this PR a little bit more (espeically with @seanpoulter) before merging... |
It doesn't only affect the default settings but also custom settings. I would dislike having to write |
sorry, just saw your comment. You meant we use shell just so users do not have to customize with their platform specific command?... giving the shell option comes with some security concern, I would think that we would prefer not to use it if we can... if the reason to use it is just for "convenience", I am not sure it outwieght the security risk we are trading off... If a window user choose to override pathToJest (that is different than the default one we provided with the correct .cmd), it is reasonable to assume they would provide the correct command otherwise the system will not work anyway... is there any other reason to use the shell option? I also see it in jest Runner... |
In principle adding the |
hmmm... you have a point. How about we take the middle ground:
I guess that is why node has the shell as a separate option instead of hard coding for windows...
we might not be able to think of any actual incident right now, but why risk it if we can avoid... |
Before adding a |
Just curious, how does windows users get their jest config settings today? Do they all end up using the default? The default won't work for typescript files, how did they work around this problem? |
I don't think that there would be a reasonable amount of users which would even just read about such a shell setting, but I'm also fine with adding it. |
Add usage of shell when gathering Jest settings
This change will finally close #274. For simplicity I created a new PR instead of modifying #297.
Independently updating
jest-editor-support
to v23.0.0 isn't a problem, since there hadn't been any larger commits (and no breaking changes) since the previously used version.I tested this PR on my Windows machine.