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

Does not work with Mootools #2591

Merged
merged 1 commit into from
Apr 5, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/middleware/karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ var createKarmaMiddleware = function (
var filePath = file.path
var fileExt = path.extname(filePath)

if (!files.included.hasOwnProperty(i)) {
continue
Copy link
Member

Choose a reason for hiding this comment

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

this continue means the things below are skipped in this case, I don't think we want to do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps. But let's say they added a new method called randomize to the Array prototype. I don't see any further processing you would want to do to that method. I'd think it should just be skipped.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What's holding up a merge?

Copy link
Member

Choose a reason for hiding this comment

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

I think this: https://github.com/karma-runner/karma/pull/2580/files#r104290773 is a better approach to fixing this issue

Copy link
Contributor Author

@Ondoher Ondoher Mar 21, 2017

Choose a reason for hiding this comment

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

My original code changed things to a forEach loop, but I thought there may be unwanted side effects or opportunities for bugs--for instance, the loop variable i is addressed in the loop. So, I kept it simple and just continued the loop on the next item if it was not an own property.

Copy link
Member

Choose a reason for hiding this comment

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

okay, but shouldn't the check then be the first thing in the loop?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess that depends on style. The style here seemed to be to have all the variable declarations at the top of the block, so I added my code underneath.

None of the existing variable initializations should have a problem dealing with an undefined value, but it could break future code. I could go either way.

}

if (!file.isUrl) {
filePath = filePathToUrlPath(filePath, basePath, urlRoot, proxyPath)

Expand Down