|
|
@ -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, |
|
|
|