Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:02
What would you like to do?
Code snippet for blog post, Retrieving Data with AngularJS and the MEAN Stack: Set Karma's browser for running tests. See complete project at:
// Karma configuration
module.exports = function (config) {
// Determines Karma's browser choice based on environment
var testBrowser = 'Chrome'; // Default browser
if (process.env.NODE_ENV === 'travis') {
testBrowser = 'PhantomJS'; // Must use for headless CI (Travis-CI)
console.log("Karma browser: " + testBrowser);
// Start these browsers, currently available:
// Chrome, ChromeCanary, Firefox, Opera,
// Safari (only Mac), PhantomJS, IE (only Windows)
browsers: [testBrowser],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment