Socket
Socket
Sign inDemoInstall

karma-structured-json-reporter

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    karma-structured-json-reporter

Full karma test results as json file


Version published
Weekly downloads
1.3K
decreased by-5.46%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Karma Structured JSON Reporter

Build Status

This is a karma reporter that will export your test data in the form of JSON but keys all describe contexts such as:

{
  "My Feature": {
    "should have a passing test": {
      "log": [],
      "time": 12,
      "status": "PASSED"
    },
    "might have a failing test": {
      "log": [
          "Expected undefined to equal 'input'."
          "http://localhost:9879/......./display.spec.js:44:36"
      ],
      "time": 14,
      "status": "FAILED"
    },
    "My Other Feature": {
      "should have a skipped test": {
          "log": [],
          "time": 0,
          "status": "SKIPPED"
      }
    }
  }
}

If an error occurs in the browser, will be written as

{
    "__BROWSER_ERRORS__": [
        "SyntaxError: Parse error",
        "at http://localhost:9877/base/app.spec.js?8e5e93760e0333550c0c67b01e552002b52e0166:31"
    ]
}

Installation

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

In your karma.conf.js add

  • 'karma-json-result-reporter' to your plugins
  • 'json-result' to your reporters
plugins: [
    ...
    'karma-json-result-reporter',
    ...
  ];

reporters: [
    'json-result'
    ...
  ],

You will also need to set the location that you need to output your JSON file.

jsonResultReporter: {
  outputFile: "karma-result.json",
  isSynchronous: true (optional, default false)
}

karma-json-result-reporter is inspired by karma-spec-json-reporter

Keywords

FAQs

Last updated on 16 Sep 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc