cdd56b95 by Gary Katsevman

One grunt test task to rule them all.

You can now test on travis with saucelabs or local browsers locally.
You can give the grunt 'test' task arguments with which browers you want
to run.
1 parent 5aada6e2
...@@ -258,10 +258,31 @@ module.exports = function(grunt) { ...@@ -258,10 +258,31 @@ module.exports = function(grunt) {
258 'concat', 258 'concat',
259 'uglify']); 259 'uglify']);
260 260
261 grunt.registerTask('test', ['jshint', 'manifests-to-js', 'karma:saucelabs']); 261 // The test task will run `karma:saucelabs` when running in travis,
262 // otherwise, it'll default to running karma in chrome.
263 // You can specify which browsers to build with by using grunt-style arguments
264 // or separating them with a comma:
265 // grunt test:chrome:firefox # grunt-style
266 // grunt test:chrome,firefox # comma-separated
267 grunt.registerTask('test', function() {
268 var tasks = this.args;
262 269
263 // travis build task 270 grunt.task.run(['jshint', 'manifests-to-js']);
264 grunt.registerTask('test-local', ['jshint', 'manifests-to-js', 'qunit']);
265 271
272 if (process.env.TRAVIS) {
273 grunt.task.run(['karma:saucelabs']);
274 } else {
275 if (tasks.length === 0) {
276 tasks.push('chrome');
277 }
278 if (tasks.length === 1) {
279 tasks = tasks[0].split(',');
280 }
281 tasks = tasks.map(function(el) {
282 return 'karma:' + el;
283 });
266 284
285 grunt.task.run(tasks);
286 }
287 });
267 }; 288 };
......
...@@ -108,6 +108,25 @@ Fired immediately after a new master or media playlist has been ...@@ -108,6 +108,25 @@ Fired immediately after a new master or media playlist has been
108 downloaded. By default, the plugin only downloads playlists as they 108 downloaded. By default, the plugin only downloads playlists as they
109 are needed. 109 are needed.
110 110
111 ### Testing
112
113 For testing, you can either run `npm test` or use `grunt` directly.
114 If you use `npm test`, it will only run the karma tests using chrome.
115 You can specify which browsers you want the tests to run via grunt's `test` task.
116 You can use either grunt-style arguments or comma separated arguments:
117 ```
118 grunt test:chrome:firefox # grunt-style
119 grunt test:chrome,firefox # comma-separated
120 ```
121 Possible options are:
122 * `chromecanary`
123 * `phantomjs`
124 * `opera`
125 * `chrome`
126 * `safari`
127 * `firefox`
128 * `ie`
129
111 ## Hosting Considerations 130 ## Hosting Considerations
112 Unlike a native HLS implementation, the HLS plugin has to comply with 131 Unlike a native HLS implementation, the HLS plugin has to comply with
113 the browser's security policies. That means that all the files that 132 the browser's security policies. That means that all the files that
......
...@@ -91,7 +91,7 @@ module.exports = function(config) { ...@@ -91,7 +91,7 @@ module.exports = function(config) {
91 91
92 // level of logging 92 // level of logging
93 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG 93 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
94 //logLevel: config.LOG_INFO, 94 logLevel: config.LOG_DISABLE,
95 95
96 // If browser does not capture in given timeout [ms], kill it 96 // If browser does not capture in given timeout [ms], kill it
97 captureTimeout: 60000 97 captureTimeout: 60000
......