Skip to content
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

test: fix tests #3953

Merged
merged 12 commits into from
Jan 19, 2017
4 changes: 2 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"presets": [ ["es2015", {"loose": true}] ],
"plugins": ["transform-es3-property-literals", "transform-es3-member-expression-literals", "inline-json"]
"presets": [ "es3", ["es2015", {"loose": true}] ],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How much size does this add to the video.js?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't. It's equivalent to using the es3 plugins but because of when and how plugins and presets are run, having the preset is more reliable for making sure that things are quoted correctly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably switch this in the generator/spellbook

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, might be good, though, I wouldn't worry too much as long as it continues to work.

"plugins": ["inline-json"]
}
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@
"aliasify": "^2.1.0",
"babel-cli": "^6.11.4",
"babel-plugin-inline-json": "^1.1.1",
"babel-plugin-transform-es3-member-expression-literals": "^6.8.0",
"babel-plugin-transform-es3-property-literals": "^6.8.0",
"babel-plugin-transform-runtime": "^6.9.0",
"babel-preset-es2015": "^6.14.0",
"babel-preset-es3": "^1.0.1",
"babel-register": "^6.9.0",
"babelify": "^7.3.0",
"blanket": "^1.1.6",
Expand Down
2 changes: 1 addition & 1 deletion src/js/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,7 @@ class Component {

const Player = Component.getComponent('Player');

if (name === 'Player' && Player) {
if (name === 'Player' && Player && Player.players) {
const players = Player.players;
const playerNames = Object.keys(players);

Expand Down
4 changes: 2 additions & 2 deletions test/globals-shim.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-env qunit */
// import 'es5-shim';
// import 'es6-shim';
import 'es5-shim';
import 'es6-shim';
import document from 'global/document';
import window from 'global/window';
import sinon from 'sinon';
Expand Down
2 changes: 1 addition & 1 deletion test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<body>
<div id="qunit"></div>
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
<!-- <script src="../build/temp/ie8/videojs-ie8.js"></script> -->
<script src="../build/temp/ie8/videojs-ie8.js"></script>

<!-- Execute the bundled tests first -->
<script src="../build/temp/tests.js"></script>
Expand Down
1 change: 1 addition & 0 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = function(config) {
// Compling tests here
files: [
'../build/temp/video-js.css',
'../build/temp/ie8/videojs-ie8.min.js',
'../test/globals-shim.js',
'../test/unit/**/*.js',
'../build/temp/browserify.js',
Expand Down
4 changes: 2 additions & 2 deletions test/unit/plugin-static.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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');
Expand Down
8 changes: 4 additions & 4 deletions test/unit/tech/html5.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ QUnit.test('test volume', function(assert) {

tech.createEl();

tech.el().volume = 0.7;
assert.strictEqual(tech.volume(), 0.7, 'can be changed from the element');
tech.el().volume = 0.5;
assert.strictEqual(tech.volume(), 0.5, 'can be changed from the element');

tech.setVolume(0.2);
assert.strictEqual(tech.volume(), 0.2, 'can be changed from the API');
tech.setVolume(1);
assert.strictEqual(tech.volume(), 1, 'can be changed from the API');
});

QUnit.test('test defaultMuted', function(assert) {
Expand Down