diff --git a/CHANGELOG.md b/CHANGELOG.md index 28977a19c..e8c11b135 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ CHANGELOG * @forbesjo added a vjs-button class to button controls ([view](https://github.com/videojs/video.js/pull/2084)) * @bc-bbay Load plugins before controls ([view](https://github.com/videojs/video.js/pull/2094)) * @bc-bbay rename onEvent methods to handleEvent ([view](https://github.com/videojs/video.js/pull/2093)) +* @dmlap added an error message if techOrder is not in options ([view](https://github.com/videojs/video.js/pull/2097)) -------------------- diff --git a/Gruntfile.js b/Gruntfile.js index e01e5cb93..74decc8e9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -269,6 +269,21 @@ module.exports = function(grunt) { } }, browserify: { + options: { + transform: [ + require('babelify').configure({ + sourceMapRelative: './src/js' + }), + ['browserify-versionify', { + placeholder: '__VERSION__', + version: pkg.version + }], + ['browserify-versionify', { + placeholder: '__VERSION_NO_PATCH__', + version: version.majorMinor + }] + ] + }, build: { files: { 'build/temp/video.js': ['src/js/video.js'] @@ -281,19 +296,15 @@ module.exports = function(grunt) { banner: license, plugin: [ [ 'browserify-derequire' ] - ], - transform: [ - require('babelify').configure({ - sourceMapRelative: './src/js' - }), - ['browserify-versionify', { - placeholder: '__VERSION__', - version: pkg.version - }], - ['browserify-versionify', { - placeholder: '__VERSION_NO_PATCH__', - version: version.majorMinor - }] + ] + } + }, + test: { + files: { + 'build/temp/tests.js': [ + 'test/globals-shim.js', + 'test/unit/**/*.js', + 'test/api/**.js' ] } } @@ -307,6 +318,9 @@ module.exports = function(grunt) { } }, coveralls: { + options: { + force: true + }, all: { src: 'test/coverage/lcov.info' } diff --git a/src/js/player.js b/src/js/player.js index cab97a541..52012cab5 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -76,6 +76,17 @@ class Player extends Component { // Run base component initializing with new options super(null, options, ready); + + // if the global option object was accidentally blown away by + // someone, bail early with an informative error + if (!this.options_ || + !this.options_.techOrder || + !this.options_.techOrder.length) { + throw new Error('No techOrder specified. Did you overwrite ' + + 'videojs.options instead of just changing the ' + + 'properties you want to override?'); + } + this.tag = tag; // Store the original tag used to set options // Store the tag attributes used to restore html5 element diff --git a/test/globals-shim.js b/test/globals-shim.js new file mode 100644 index 000000000..cbcf7b034 --- /dev/null +++ b/test/globals-shim.js @@ -0,0 +1,10 @@ +import window from 'global/window'; +import sinon from 'sinon'; + +window.q = QUnit; +window.sinon = sinon; + +// This may not be needed anymore, but double check before removing +window.fixture = document.createElement('div'); +fixture.id = 'qunit-fixture'; +document.body.appendChild(fixture); diff --git a/test/index.html b/test/index.html new file mode 100644 index 000000000..41b1268b6 --- /dev/null +++ b/test/index.html @@ -0,0 +1,15 @@ + + +
+ +