Coder Social home page Coder Social logo

karma-cordova-launcher's Introduction

karma-cordova-launcher

Run your unit tests on Android, iOS, etc using Apache Cordova

Installation

Install karma-cordova-launcher as a devDependency in your package.json:

npm install karma-cordova-launcher --save-dev

Note: This plugin currently depends on cordova being on your PATH. You can install cordova globally by:

npm install -g cordova

Usage

This launcher is typically used to test your unit tests locally on a mobile device emulator. It is expected that you are already familiar with Karma when configuring this launcher, so if you are new to Karma, head over to the Karma website.

Adding karma-cordova-launcher to an existing Karma config

To configure this launcher, you need to add the cordovaSettings property to your top-level Karma config. The browsers array needs to include Cordova.

The cordovaSettings object defines global settings for Cordova. Here is a sample Karma config to get the launcher running:

module.exports = function(config) {
  // Example set of mobile platforms to run on Cordova
  config.set({
    // The rest of your karma config is here
    // ...
    cordovaSettings: {
      platforms: ['android', 'ios'],
      plugins: [
        'org.apache.cordova.console'
      ]
    },
    browsers: ['Cordova'],
    reporters: ['dots', 'progress']
    singleRun: true
  });
};

Example karma-cordova-launcher configs

For example configs using this launcher, check out the Grunt and Karma configuration for freedom-for-chrome

cordovaSettings config properties

platforms

Type: Array of String Default: []

An array of Cordova platforms to test on. For valid values, see Cordova Platform Support

plugins

Type: Array of String Default: []

An array of Cordova plugins to install. For valid plugins, see the Cordova Plugins Registry

Runtime FAQ

  • What platforms have been tested?
    • Android L on Ubuntu 14.04LTS with Cordova 3.5.0
    • Must set an SD card and "Use Host GPU" in device settings
  • Where is the Cordova project generated?
    • The project is stored here: /tmp/cordova_test/. Delete it to start fresh

karma-cordova-launcher's People

Contributors

ryscheng avatar

Watchers

James Cloos 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.