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) {
'concat',
'uglify']);
grunt.registerTask('test', ['jshint', 'manifests-to-js', 'karma:saucelabs']);
// The test task will run `karma:saucelabs` when running in travis,
// otherwise, it'll default to running karma in chrome.
// You can specify which browsers to build with by using grunt-style arguments
// or separating them with a comma:
// grunt test:chrome:firefox # grunt-style
// grunt test:chrome,firefox # comma-separated
grunt.registerTask('test', function() {
var tasks = this.args;
// travis build task
grunt.registerTask('test-local', ['jshint', 'manifests-to-js', 'qunit']);
grunt.task.run(['jshint', 'manifests-to-js']);
if (process.env.TRAVIS) {
grunt.task.run(['karma:saucelabs']);
} else {
if (tasks.length === 0) {
tasks.push('chrome');
}
if (tasks.length === 1) {
tasks = tasks[0].split(',');
}
tasks = tasks.map(function(el) {
return 'karma:' + el;
});
grunt.task.run(tasks);
}
});
};
......
......@@ -108,6 +108,25 @@ Fired immediately after a new master or media playlist has been
downloaded. By default, the plugin only downloads playlists as they
are needed.
### Testing
For testing, you can either run `npm test` or use `grunt` directly.
If you use `npm test`, it will only run the karma tests using chrome.
You can specify which browsers you want the tests to run via grunt's `test` task.
You can use either grunt-style arguments or comma separated arguments:
```
grunt test:chrome:firefox # grunt-style
grunt test:chrome,firefox # comma-separated
```
Possible options are:
* `chromecanary`
* `phantomjs`
* `opera`
* `chrome`
* `safari`
* `firefox`
* `ie`
## Hosting Considerations
Unlike a native HLS implementation, the HLS plugin has to comply with
the browser's security policies. That means that all the files that
......
......@@ -91,7 +91,7 @@ module.exports = function(config) {
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
//logLevel: config.LOG_INFO,
logLevel: config.LOG_DISABLE,
// If browser does not capture in given timeout [ms], kill it
captureTimeout: 60000
......