You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Okay. I am opening this new pull request to fix all of the merge issues of my last pull request (Issue #4097).
The code here takes all of the array of expected file extensions and makes sure it contains the actual file extensions, thus doing away with the problem of having to make the file extension arrays match.
I have tested this under my Windows VM and everything appears to work.
The reason will be displayed to describe this comment to others. Learn more.
This code never goes in the loop because actual.getFileExtensions is a reference to a function, it's not actually calling the function. It happens to have a length property that's 0. You can click on Show Developer Tools from the Jasmine Spec Runner Window, the click on the Source tab and set a breakpoint in the code to see what branches it takes and inspect the structure and value of object. This should be actual.getFileExtensions().length instead.
Even better would be to only call actual.getFileExtensions() once and store it in a local var.
The reason will be displayed to describe this comment to others. Learn more.
This block of code:
var expectedFileExtensions;
// Be sure that expectedFileExtensions is not undefined.
if (expected.fileExtensions === undefined) {
expectedFileExtensions = [];
} else {
expectedFileExtensions = expected.fileExtensions;
}
Can be replaced by this line of code:
var expectedFileExtensions = expected.fileExtensions || [];
When initializing expectedFileExtensions, it's set to the first "truthy" element in the OR list. So, if expected.fileExtensions is undefined (or null), then it's set to [] (an empty array). This code is actually better because it checks for both undefined and null;
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
2 participants
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.
This for (Issue #3957.
Okay. I am opening this new pull request to fix all of the merge issues of my last pull request (Issue #4097).
The code here takes all of the array of expected file extensions and makes sure it contains the actual file extensions, thus doing away with the problem of having to make the file extension arrays match.
I have tested this under my Windows VM and everything appears to work.