-
Notifications
You must be signed in to change notification settings - Fork 21
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 useDashedArgs workspace setting #103
Conversation
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.
@mjamin Thanks for the PR, it looked good. Just some minor suggestions for new test cases.
|
||
const args = (createProcess: any).mock.calls[0][1]; | ||
expect(args[0]).toBe(expected); | ||
}); |
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.
let's add some test case to ensure user passed in args (options.args.args) will also be converted. Also add test cases to ensure if any of the arguments are already in dashed style, it will not be altered.
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.
Looks good. It would be great if you could address this one minor style issue...
src/Runner.js
Outdated
@@ -88,6 +88,16 @@ export default class Runner extends EventEmitter { | |||
if (this.options.args) { | |||
args.push(...this.options.args.args); | |||
} | |||
if (this.workspace.useDashedArgs) { | |||
args.forEach((arg, index) => { |
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.
This code is not wrong, but usually, we use map
for transformation operations. This might be more of a style and convention rather than correctness...
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.
great, thanks!
See this for context.