-
Notifications
You must be signed in to change notification settings - Fork 251
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
V7: Update config behaviour and plugin interface #759
Conversation
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.
A couple of comment to consider. Mostly I'm unsure about the expect(x).toBe(x)
assertions, of which there are many.
|
||
function handleXHRError () { | ||
if (includes(getIgnoredUrls, this[REQUEST_URL_KEY])) { |
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.
Was this a bug then?
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.
oh, I didn't even notice. Looks like it was!
const after = process.listeners('uncaughtException').length | ||
expect(after - before).toBe(1) | ||
expect(c).toBe(c) |
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.
What is the purpose of these assertions?
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.
Appeasing the linter :(
instantiating a client and then not referring to it leads to an unused variable error. If I remove the assignment to client
, it errors with the "don't use new for side effects" rule.
I didn't want to ignore the line where it was instantiated, so this seemed like the least bad option. I'm sure there's a better way.
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.
Fair enough. We can revisit this as part of the TS conversion.
The spec now stipulates that the only invalid configuration that should throw an error is
apiKey
. All others should log a warning and proceed with the default value.The plugin interface has also been updated.
init()
is nowload()
, and theclient.use()
method has been disabled in favour of passing plugins in toconfig.plugins[]
.Todo: