douglasduteil/karma-json-reporter


JSON reporter for Karma

License: MIT

Language: JavaScript

Keywords: javascript, json-report, karma


karma-json-reporter

Build Status npm JavaScript Style Guide

JSON reporter for Karma

Installation

The easiest way is to keep karma-json-reporter as a devDependency in your package.json.

{
  "devDependencies": {
    "karma": "~0.10",
    "karma-json-reporter": "~1.1"
  }
}

You can simple do it by:

npm install karma-json-reporter --save-dev

Usage

Use it as a reporter

// karma.conf.js
module.exports = function(config) {
  // ...

    // json reporter directly output stringified json
    reporters: ['json'],
    jsonReporter: {
      stdout: true,
      outputFile: 'results.json' // defaults to none
    }

  // ...
};

Output data

{
  "browsers": { // Collection of used browser
    "<browser.id>": {
      "id": "<same browser.id>",
      "fullName": String,
      "name": String,
      "state": Number,
      "lastResult": {
        "success":Number,
        "failed": Number,
        "skipped": Number,
        "total": Number,
        "totalTime": Number,
        "netTime":Number,
        "error": Boolean,
        "disconnected": Boolean
      },
      "launchId": Number
    }
  },
  "result": { // Collection result per browser
    "<browser.id>": [
      {
        "id": Number, // spec.id
        "description": String, // spec.description
        "suite": Array.of(String), // spec.suite
        "success": Boolean,
        "skipped": Boolean,
        "time": Number,
        "log": Array.of(String), // spec.log
      },
    ]
  },
  "summary": {
    "success": Number, // total number of success
    "failed": Number, // total number of fail
    "error": Boolean,
    "disconnected": Boolean,
    "exitCode": Number
  }
}

Output example

Project Statistics

Sourcerank 7
Repository Size 45.9 KB
Stars 7
Forks 17
Watchers 1
Open issues 4
Dependencies 179
Contributors 8
Tags 3
Created
Last updated
Last pushed

Top Contributors See all

Douglas Duteil René Ras Rifat Nabi Martin Vseticka jdsipes Micha Reiser Erick Remon Oldenbeuving

Packages Referencing this Repo

karma-json-reporter
JSON reporter for Karma
Latest release 1.2.1 - Updated - 7 stars

Recent Tags See all

v1.2.0 July 20, 2015
v1.1.0 November 04, 2014
v1.0.0 December 19, 2013

Interesting Forks See all

skroutz/karma-json-reporter
JSON reporter for Karma
JavaScript - Last pushed - 1 stars

Something wrong with this page? Make a suggestion

Last synced: 2016-05-27 14:30:14 UTC

Login to resync this repository