-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Don't mutate the source #2418
Don't mutate the source #2418
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,15 @@ test('should add the value to the languages object with lower case lang code', f | |
deepEqual(result, globalOptions['languages'][code.toLowerCase()], 'should also match'); | ||
}); | ||
|
||
test('should allow setting global options', function() { | ||
videojs.setGlobalOptions({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The fact this does a merge and not an overwrite strikes me as really odd but that's a separate discussion. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree it feels a little weird, but if it did an overwrite you'd have to include every option every time instead of being able to just set one or a few. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The converse of that is you can no longer remove an option that has been set. |
||
nonsense: true | ||
}); | ||
|
||
equal(videojs.getGlobalOptions().nonsense, true, 'set the new option'); | ||
deepEqual(videojs.options, videojs.getGlobalOptions(), 'updated the options property'); | ||
}); | ||
|
||
test('should expose plugin registry function', function() { | ||
var pluginName, pluginFunction, player; | ||
|
||
|
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 we add some comments to these lines? Takes a bit to grok as is.
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.
Sure thing