-
Notifications
You must be signed in to change notification settings - Fork 144
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
Initialize var suites early #112
Initialize var suites early #112
Conversation
As karma-runner#61 (comment) Minor cleanup. Doing it this way should be faster though (no constructor call overhead, less code to begin with).
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it. |
CLAs look good, thanks! |
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.
Looks good to me
Are you sure you can remove the init from |
I'm especially thinking about runs with |
The reset is exactly what was causing issues. In some cases the onRunComplete() event would reset the suites object (set it to null) and then a different run (that was running simultaneously) would access it. Kaboom. See the commit merged to the tip of master - there's a reason that is done. |
Thanks |
As an aside, I'm pretty sure a casual look at other reporters would show a repeat of this exact same pattern. The only one I have in our builds is the Jenkins reporter, and that one does this: this.onRunStart = function(browsers) {
|
As #61 (comment)
Minor cleanup. Doing it this way should be faster though (no constructor call overhead, less code to begin with).
Credit goes to https://github.com/robinj for this one. I just implemented it.