From 51b836d6be2a2343f0f9928e1a8631b1a6811f9f Mon Sep 17 00:00:00 2001 From: Christopher Currie Date: Fri, 17 Jan 2014 14:18:09 -0800 Subject: [PATCH 1/3] Update to karma 0.10/grunt-karma 0.6. Current version of grunt-karma has ChromeLauncher bugs. --- package.json | 5 +- test/karma.conf.js.example | 156 +++++++++++++++++++------------------ 2 files changed, 82 insertions(+), 79 deletions(-) diff --git a/package.json b/package.json index c9e080866..c3d1f421a 100644 --- a/package.json +++ b/package.json @@ -34,8 +34,9 @@ "grunt-contrib-cssmin": "~0.6.0", "uglify-js": "~2.3.6", "grunt-contrib-less": "~0.6.4", - "grunt-karma": "~0.4.4", - "karma-qunit": "~0.0.2", + "grunt-karma": "~0.6.2", + "karma": "~0.10.0", + "karma-qunit": "~0.1.1", "videojs-doc-generator": "0.0.1", "qunitjs": "~1.12.0" }, diff --git a/test/karma.conf.js.example b/test/karma.conf.js.example index 7426965c4..1e0996522 100644 --- a/test/karma.conf.js.example +++ b/test/karma.conf.js.example @@ -4,98 +4,100 @@ // 2. Configure the properties below in your conf.js copy // 3. Run your tests -// base path, that will be used to resolve files and exclude -basePath = ''; +module.exports = function(config) { + config.set({ + // base path, that will be used to resolve files and exclude + basePath: '', -frameworks = ['qunit']; + frameworks: ['qunit'], -// Set autoWatch to true if you plan to run `grunt karma` continuously, to automatically test changes as you make them. -autoWatch = false; + // Set autoWatch to true if you plan to run `grunt karma` continuously, to automatically test changes as you make them. + autoWatch: false, -// Setting singleRun to true here will start up your specified browsers, run tests, and then shut down the browsers. Helpful to have in a CI environment, where you don't want to leave browsers running continuously. -singleRun = true; + // Setting singleRun to true here will start up your specified browsers, run tests, and then shut down the browsers. Helpful to have in a CI environment, where you don't want to leave browsers running continuously. + singleRun: true, -// Start these browsers, currently available: -// - Chrome -// - ChromeCanary -// - Firefox -// - Opera -// - Safari (only Mac) -// - PhantomJS -// - IE (only Windows) -// Example usage: -// browsers = ['Chrome','Firefox','Safari']; -browsers = []; + // Start these browsers, currently available: + // - Chrome + // - ChromeCanary + // - Firefox + // - Opera + // - Safari (only Mac) + // - PhantomJS + // - IE (only Windows) + // Example usage: + // browsers = ['Chrome','Firefox','Safari']; + browsers: [], -// List of files / patterns to load in the browser -// Add any new src files to this list. -// If you add new unit tests, they will be picked up automatically by Karma, -// unless you've added them to a nested directory, in which case you should -// add their paths to this list. -files = [ - '../test/karma-qunit-shim.js', - QUNIT, - QUNIT_ADAPTER, - '../src/js/core.js', - '../src/js/core-object.js', - '../src/js/events.js', - '../src/js/lib.js', - '../src/js/component.js', - '../src/js/button.js', - '../src/js/slider.js', - '../src/js/menu.js', - '../src/js/player.js', - '../src/js/control-bar/control-bar.js', - '../src/js/control-bar/play-toggle.js', - '../src/js/control-bar/time-display.js', - '../src/js/control-bar/fullscreen-toggle.js', - '../src/js/control-bar/progress-control.js', - '../src/js/control-bar/volume-control.js', - '../src/js/control-bar/mute-toggle.js', - '../src/js/control-bar/volume-menu-button.js', - '../src/js/poster.js', - '../src/js/loading-spinner.js', - '../src/js/big-play-button.js', - '../src/js/media/media.js', - '../src/js/media/html5.js', - '../src/js/media/flash.js', - '../src/js/media/loader.js', - '../src/js/tracks.js', - '../src/js/json.js', - '../src/js/setup.js', - '../src/js/plugins.js', - '../test/unit/*.js' -]; + // List of files / patterns to load in the browser + // Add any new src files to this list. + // If you add new unit tests, they will be picked up automatically by Karma, + // unless you've added them to a nested directory, in which case you should + // add their paths to this list. + files: [ + '../test/karma-qunit-shim.js', + '../src/js/core.js', + '../src/js/core-object.js', + '../src/js/events.js', + '../src/js/lib.js', + '../src/js/component.js', + '../src/js/button.js', + '../src/js/slider.js', + '../src/js/menu.js', + '../src/js/player.js', + '../src/js/control-bar/control-bar.js', + '../src/js/control-bar/play-toggle.js', + '../src/js/control-bar/time-display.js', + '../src/js/control-bar/fullscreen-toggle.js', + '../src/js/control-bar/progress-control.js', + '../src/js/control-bar/volume-control.js', + '../src/js/control-bar/mute-toggle.js', + '../src/js/control-bar/volume-menu-button.js', + '../src/js/poster.js', + '../src/js/loading-spinner.js', + '../src/js/big-play-button.js', + '../src/js/media/media.js', + '../src/js/media/html5.js', + '../src/js/media/flash.js', + '../src/js/media/loader.js', + '../src/js/tracks.js', + '../src/js/json.js', + '../src/js/setup.js', + '../src/js/plugins.js', + '../src/js/util.js', + '../test/unit/*.js' + ], -plugins = ['karma-qunit', 'karma-chrome-launcher']; + plugins: ['karma-qunit', 'karma-chrome-launcher'], -// list of files to exclude -exclude = [ - -]; + // list of files to exclude + exclude: [ + + ], -// test results reporter to use -// possible values: 'dots', 'progress', 'junit' -reporters = ['progress']; + // test results reporter to use + // possible values: 'dots', 'progress', 'junit' + reporters: ['progress'], -// web server port -port = 9876; + // web server port + port: 9876, -// cli runner port -runnerPort = 9100; + // cli runner port + runnerPort: 9100, -// enable / disable colors in the output (reporters and logs) -colors = true; + // enable / disable colors in the output (reporters and logs) + colors: true, -// level of logging -// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG -//logLevel = LOG_INFO; - -// If browser does not capture in given timeout [ms], kill it -captureTimeout = 60000; + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + //logLevel: config.LOG_INFO, + // If browser does not capture in given timeout [ms], kill it + captureTimeout: 60000 + }); +}; \ No newline at end of file From a54d9cdae6878684b76a4ddb0fdf9487dad4e9aa Mon Sep 17 00:00:00 2001 From: Christopher Currie Date: Tue, 21 Jan 2014 08:42:40 -0800 Subject: [PATCH 2/3] Add dependencies and configuration for all browser launchers --- package.json | 6 ++++++ test/karma.conf.js.example | 14 +++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c3d1f421a..da652cf5a 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,12 @@ "grunt-contrib-less": "~0.6.4", "grunt-karma": "~0.6.2", "karma": "~0.10.0", + "karma-chrome-launcher": "*", + "karma-firefox-launcher": "*", + "karma-ie-launcher": "*", + "karma-opera-launcher": "*", + "karma-phantomjs-launcher": "*", + "karma-safari-launcher": "*", "karma-qunit": "~0.1.1", "videojs-doc-generator": "0.0.1", "qunitjs": "~1.12.0" diff --git a/test/karma.conf.js.example b/test/karma.conf.js.example index 1e0996522..df662ae8f 100644 --- a/test/karma.conf.js.example +++ b/test/karma.conf.js.example @@ -26,7 +26,7 @@ module.exports = function(config) { // - PhantomJS // - IE (only Windows) // Example usage: - // browsers = ['Chrome','Firefox','Safari']; + // browsers: ['Chrome','Firefox','Safari'], browsers: [], // List of files / patterns to load in the browser @@ -68,7 +68,15 @@ module.exports = function(config) { '../test/unit/*.js' ], - plugins: ['karma-qunit', 'karma-chrome-launcher'], + plugins: [ + 'karma-qunit', + 'karma-chrome-launcher', + 'karma-firefox-launcher', + 'karma-ie-launcher', + 'karma-opera-launcher', + 'karma-phantomjs-launcher', + 'karma-safari-launcher' + ], // list of files to exclude exclude: [ @@ -100,4 +108,4 @@ module.exports = function(config) { // If browser does not capture in given timeout [ms], kill it captureTimeout: 60000 }); -}; \ No newline at end of file +}; From 9088dfffc9b4c7f01f6169d7caf7b678d5770839 Mon Sep 17 00:00:00 2001 From: Christopher Currie Date: Tue, 21 Jan 2014 08:45:59 -0800 Subject: [PATCH 3/3] Use specific launcher versions --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index da652cf5a..658fd2672 100644 --- a/package.json +++ b/package.json @@ -36,12 +36,12 @@ "grunt-contrib-less": "~0.6.4", "grunt-karma": "~0.6.2", "karma": "~0.10.0", - "karma-chrome-launcher": "*", - "karma-firefox-launcher": "*", - "karma-ie-launcher": "*", - "karma-opera-launcher": "*", - "karma-phantomjs-launcher": "*", - "karma-safari-launcher": "*", + "karma-chrome-launcher": "~0.1.2", + "karma-firefox-launcher": "~0.1.3", + "karma-ie-launcher": "~0.1.1", + "karma-opera-launcher": "~0.1.0", + "karma-phantomjs-launcher": "~0.1.1", + "karma-safari-launcher": "~0.1.1", "karma-qunit": "~0.1.1", "videojs-doc-generator": "0.0.1", "qunitjs": "~1.12.0"