Skip to content
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

Merged
merged 3 commits into from Jun 13, 2023

Conversation

mjamin
Copy link
Contributor

@mjamin mjamin commented May 21, 2023

See this for context.

Copy link
Collaborator

@connectdotz connectdotz left a 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);
});
Copy link
Collaborator

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.

connectdotz
connectdotz previously approved these changes Jun 10, 2023
Copy link
Collaborator

@connectdotz connectdotz left a 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) => {
Copy link
Collaborator

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...

Copy link
Collaborator

@connectdotz connectdotz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, thanks!

@connectdotz connectdotz merged commit 28a0be7 into jest-community:master Jun 13, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants