Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
chore: convert screenshots.js to screenshots.ts #30758
chore: convert screenshots.js to screenshots.ts #30758
Changes from 2 commits
54be464
70652e5
7d6e3a0
51d4722
7240597
7f4d2b4
aad6277
30e51c2
883025f
f7e5958
19b803c
1315102
a794ab4
cb5fb99
eaefb69
6ee3416
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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'm not sure what the next line is even doing;
_.concat
only operates on arrays, and"someString".concat([]) === "someString"
. The next line can likely be removed, but I'd make sure the values are what they're expected to be if you do.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.
Ryan had some thoughts on what this is doing here: #30758 (comment)
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.
@cacieprins @ryanthemanuel Yah....it does not like any changes to this area. I'm going to leave it alone. 😬 I don't really understand why it's needed either.
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.
Yeah I think I get what it's doing, but lodash types don't like it even though you can do it.
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.
Hey, while I was working on this part of code in my PR, I found that this is done so that type of the variable is same in both if and else branch. I guess that is why it breaks, as the type for
name
variable becomes different in case of if and else branches, and the remaining code that usesnames
breaks on one type or other. I fixed it by replacing the concat by putting it in array.Relevant lines from my PR https://github.com/cypress-io/cypress/pull/30673/files#diff-471ce7b0d88e3cdc126b6c5e781d074d86a828e5a7d88b9584db3385be09e569R88-R97