diff --git a/README.md b/README.md index 28a2347d..a1ff3a22 100644 --- a/README.md +++ b/README.md @@ -672,8 +672,7 @@ will stall. Fragmented MP4s are only supported on browser that have ## Testing -For testing, you run `npm run test`. This will run tests using any of the -browsers that karma-detect-browsers detects on your machine. +For testing, you run `npm run test`. You will need Chrome, Chrome Canary and Firefox for running the tests. ## Debugging diff --git a/package.json b/package.json index 45eb0b5a..fe71bfa1 100644 --- a/package.json +++ b/package.json @@ -35,10 +35,6 @@ "start:serve": "babel-node scripts/server.js", "pretest": "npm-run-all lint build", "test": "karma start test/karma.conf.js", - "test:chrome": "npm run pretest && karma start test/karma.conf.js --browsers Chrome", - "test:firefox": "npm run pretest && karma start test/karma.conf.js --browsers Firefox", - "test:ie": "npm run pretest && karma start test/karma.conf.js --browsers IE", - "test:safari": "npm run pretest && karma start test/karma.conf.js --browsers Safari", "preversion": "npm test", "version": "npm run build", "watch": "npm-run-all -p watch:*", @@ -119,7 +115,6 @@ "karma-browserify": "^4.4.0", "karma-chrome-launcher": "^2.2.0", "karma-coverage": "^1.1.1", - "karma-detect-browsers": "^2.0.0", "karma-firefox-launcher": "^1.1.0", "karma-ie-launcher": "^0.2.0", "karma-qunit": "^1.2.1", diff --git a/test/karma.conf.js b/test/karma.conf.js index 7ddce48a..6d386b8f 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -3,33 +3,18 @@ var isparta = require('isparta'); module.exports = function(config) { - var detectBrowsers = { - enabled: false, - usePhantomJS: false, - postDetection: function(availableBrowsers) { - var safariIndex = availableBrowsers.indexOf('Safari'); - - if(safariIndex !== -1) { - availableBrowsers.splice(safariIndex, 1); - console.log("Disabled Safari as it was/is not supported"); - } - return availableBrowsers; - } - }; if (process.env.TRAVIS) { config.browsers = ['ChromeHeadlessNoSandbox']; + } else { + config.browsers = ['ChromeHeadlessNoSandbox', 'ChromeCanaryHeadlessNoSandbox', 'FirefoxHeadless']; } // If no browsers are specified, we enable `karma-detect-browsers` // this will detect all browsers that are available for testing - if (!config.browsers.length) { - detectBrowsers.enabled = true; - } - config.set({ basePath: '..', - frameworks: ['qunit', 'browserify', 'detectBrowsers'], + frameworks: ['qunit', 'browserify'], files: [ 'node_modules/sinon/pkg/sinon.js', 'node_modules/sinon/pkg/sinon-ie.js', @@ -47,8 +32,12 @@ module.exports = function(config) { customLaunchers: { ChromeHeadlessNoSandbox: { base: 'ChromeHeadless', - flags: ['--no-sandbox'] - } + flags: ['--no-sandbox', '--autoplay-policy=no-user-gesture-required'] + }, + ChromeCanaryHeadlessNoSandbox: { + base: 'ChromeCanaryHeadless', + flags: ['--no-sandbox', '--autoplay-policy=no-user-gesture-required'], + } }, preprocessors: { 'test/**/*.test.js': ['browserify'] @@ -72,7 +61,6 @@ module.exports = function(config) { return file.originalPath; } }, - detectBrowsers: detectBrowsers, reporters: ['dots'], port: 9876, colors: true,