-
Notifications
You must be signed in to change notification settings - Fork 94
fix: ensure karma.config is passed (#192) #206
base: master
Are you sure you want to change the base?
Conversation
Seems the change is pretty harmless. @johnjbarton What do you think? |
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 think this project needs some work on the package.json and such.
var clientArguments | ||
config = config || {} | ||
clientArguments = config.args | ||
return function () { |
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.
Could there be existing callers in other code that expect the argument to be used?
clientArguments = config.args | ||
return function () { | ||
var config = karma.config || {} | ||
var clientArguments = config.args |
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.
Move these two lines up before the return statement. They will execute during file-load so the clientArguments will be available then, rather than only later during the load-event handling.
That has no impact, but in the case of karma-jasmine, the config values can be used to reset jasmine.DEFAULT_TIMEOUT_INTERVAL and it must be set during file-load.
@@ -173,12 +173,11 @@ var createMochaReporterConstructor = function (tc, pathname) { | |||
} | |||
} | |||
/* eslint-disable no-unused-vars */ | |||
var createMochaStartFn = function (mocha) { | |||
var createMochaStartFn = function (karma, mocha) { |
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.
Make karma the second argument so existing code calling with one argument will work.
config = config || {} | ||
clientArguments = config.args | ||
return function () { | ||
var config = karma.config || {} |
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.
safer would be to leave the config
parameter and
config = config ? config : (karma ? karma.config || {} : {}
No description provided.