I\'m using the Karma Test Runner and I\'ve configured it to use Chrome and PhantomJS like this:
browsers = [\'Chrome\', \'PhantomJS\'];
How can I configure Karma
One solution I found, which may not be the most elegant, is to actually modify Karma's launcher scripts for each browser. This has solved the problem.
Something like this should work:
// karma.conf.js
module.exports = function(config) {
config.set({
browsers: ['Chrome_without_security','PhantomJS_without_security'],
// you can define custom flags
customLaunchers: {
Chrome_without_security: {
base: 'Chrome',
flags: ['--disable-web-security']
},
PhantomJS_without_security: {
base: 'PhantomJS',
flags: ['--web-security=no']
}
}
});
};
More information here: https://github.com/karma-runner/karma-chrome-launcher#configuration