Giter VIP home page Giter VIP logo

karma-json-reporter's Introduction

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

karma-json-reporter's People

Contributors

douglasduteil avatar erickmc avatar martyix avatar reneras avatar rso avatar torifat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

karma-json-reporter's Issues

ReferenceError: log is not defined

ERROR [karma]: [ReferenceError: log is not defined]
ReferenceError: log is not defined
    at /home/vagrant/github/karma_test/node_modules/karma-json-reporter/index.js:38:11
    at /home/vagrant/github/karma_test/node_modules/karma/node_modules/chokidar/node_modules/readdirp/node_modules/graceful-fs/graceful-fs.js:104:5
    at Object.oncomplete (fs.js:108:15)

here: https://github.com/douglasduteil/karma-json-reporter/blob/master/index.js#L38

Is there some package i haven't required?

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.