mirror of
https://github.com/videojs/video.js.git
synced 2025-11-29 23:07:51 +02:00
test: fix tests (#3953)
* Switch to es3 preset for babel so that it runs last. Plugins run before presets and presets run in reverse order. Also, we ran into a weird bug in babel that causes `default` not to be quoted in some cases (https://github.com/babel/babel/issues/4799) which we've worked around here. * Restore the es-shims for tests and the ie8 fallback script. * Do a null-check around `Player.players`. * use more round fractions (like 0.5 and 1) to avoid rounding issues.
This commit is contained in:
@@ -29,7 +29,7 @@ QUnit.test('registerPlugin() works with basic plugins', function(assert) {
|
||||
|
||||
assert.strictEqual(Plugin.registerPlugin('foo', foo), foo, 'the plugin is returned');
|
||||
assert.strictEqual(Plugin.getPlugin('foo'), foo, 'the plugin can be retrieved');
|
||||
assert.strictEqual(typeof Player.prototype.foo, 'function', 'the plugin has a wrapper function');
|
||||
assert.strictEqual(Object.prototype.toString.call(Player.prototype.foo), '[object Function]', 'the plugin has a wrapper function');
|
||||
assert.notStrictEqual(Player.prototype.foo, foo, 'the function on the player prototype is a wrapper');
|
||||
|
||||
Plugin.deregisterPlugin('foo');
|
||||
@@ -40,7 +40,7 @@ QUnit.test('registerPlugin() works with class-based plugins', function(assert) {
|
||||
|
||||
assert.strictEqual(Plugin.registerPlugin('foo', Foo), Foo, 'the plugin is returned');
|
||||
assert.strictEqual(Plugin.getPlugin('foo'), Foo, 'the plugin can be retrieved');
|
||||
assert.strictEqual(typeof Player.prototype.foo, 'function', 'the plugin has a factory function');
|
||||
assert.strictEqual(Object.prototype.toString.call(Player.prototype.foo), '[object Function]', 'the plugin has a factory function');
|
||||
assert.notStrictEqual(Player.prototype.foo, Foo, 'the function on the player prototype is a factory');
|
||||
|
||||
Plugin.deregisterPlugin('foo');
|
||||
|
||||
Reference in New Issue
Block a user