Code Monkey home page Code Monkey logo

karma-chrome-launcher's Introduction

karma-chrome-launcher

js-standard-style npm version npm downloads

Build Status Dependency Status devDependency Status

Launcher for Google Chrome, Google Chrome Canary and Google Chromium.

Installation

The easiest way is to keep karma-chrome-launcher as a devDependency in your package.json, by running

$ npm install karma-chrome-launcher --save-dev

Configuration

// karma.conf.js
module.exports = function(config) {
  config.set({
    browsers: ['Chrome', 'Chrome_without_security'], // You may use 'ChromeCanary', 'Chromium' or any other supported browser

    // you can define custom flags
    customLaunchers: {
      Chrome_without_security: {
        base: 'Chrome',
        flags: ['--disable-web-security']
      }
    }
  })
}

The --user-data-dir is set to a temporary directory but can be overridden on a custom launcher as shown below. One reason to do this is to have a permanent Chrome user data directory inside the project directory to be able to install plugins there (e.g. JetBrains IDE Support plugin).

customLaunchers: {
  Chrome_with_debugging: {
    base: 'Chrome',
    chromeDataDir: path.resolve(__dirname, '.chrome')
  }
}

You can pass list of browsers as a CLI argument too:

$ karma start --browsers Chrome,Chrome_without_security

Headless Chromium with Puppeteer

Chrome team made Puppeteer. It will automatically install Chromium for all platforms, so you can easily use it within your CI. Everything that you need, it's to install package and update your Karma config.

$ npm install puppeteer --save-dev
// karma.conf.js
process.env.CHROME_BIN = require('puppeteer').executablePath()

module.exports = function(config) {
  config.set({
    browsers: ['ChromeHeadless']
  })
}

Available browsers

  • Chrome
  • ChromeCanary
  • Chromium
  • ChromeHeadless (only on Chrome >= 59)
  • ChromeCanaryHeadless (only on Chrome >= 59)
  • Dartium

For more information on Karma see the homepage.

karma-chrome-launcher's People

Contributors

23x23x avatar alias-mac avatar aymericbeaumet avatar cexbrayat avatar dignifiedquire avatar dpogue avatar fidge123 avatar florian-r avatar frsimond avatar greenkeeperio-bot avatar haifengkao avatar ishitatsuyuki avatar jeffbcross avatar krinkle avatar maieutiquer avatar mgol avatar mvuksano avatar nimi avatar rogeriopvl avatar sukrosono avatar vojtajina avatar zzo avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.