-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Karma is not able to run if any methods in Array.prototype
are modified beforehand.
#2671
Karma is not able to run if any methods in Array.prototype
are modified beforehand.
#2671
Comments
Use `forEach` instead of `for..in` as it's better practices and fix karma-runner#2671.
Use `forEach` instead of `for..in` as it's better practices and fix karma-runner#2671.
Question - what are you trying to accomplish with modifying There is a particular scenario that the |
@wesleycho In fact, I totally agree with you but that was written by someone else and I wasn't able to modify that at the time. I am more like trying to figure out why |
That will be possible when we start official work on 2.0 to remove node 0.10 and 0.12 support :) . We may be able to switch to |
As for |
I don't think there is a specific reason for using |
- Change use of for..in to plain for loop due to issues where array prototype is modified Fixes karma-runner#2671
Expected behaviour
Karma should be running.
Actual behaviour
Not able to parse the paths given in the
config.files
and throw an error:Environment Details
karma --version
):v1.6.0
v7.9.0
karma.config.js
fileSteps to reproduce the behaviour
Run this snippet of script:
Cause
At this line in
lib/middleware/karma.js
:for...in
is used to traverse an array and this is a known bad practice. Maybe there is a particular reason for using it here?The text was updated successfully, but these errors were encountered: