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

Comparing version 0.6.1 to 0.6.2

0

index.js

@@ -0,0 +0,0 @@ var path = require('path');

2

package.json
{
"name": "karma-structured-json-reporter",
"version": "0.6.1",
"version": "0.6.2",
"description": "Full karma test results as json file",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -5,4 +5,84 @@ # Karma Structured JSON Reporter

**README file to be changed...**
See example folder for time being.
This is a karma reporter that will generate a structured JSON report of the karma results.
The results are very similar to the internal karma result objects, with some tweaks. See below:
```
{
"errors": [],
"results": [
{
"description": "has a test that passes",
"id": "spec0",
"log": [],
"skipped": false,
"success": true,
"suite": [
"A suite"
],
"time": 8,
"executedExpectationsCount": 1
},
{
"description": "has a test that fails",
"id": "spec1",
"log": [
"Expected true to be false.",
"http://localhost:9876/base/tests.js?91dda573b163812b198bbe16d044180c266573af:9:22",
"loaded@http://localhost:9876/context.js:151:17"
],
"skipped": false,
"success": false,
"suite": [
"A suite"
],
"time": 5,
"executedExpectationsCount": 1
}
]
}
```
If an error occurs in the browser, for example a disconnection, it will be added to the errors array.
## Installation
```
npm install --save-dev karma-structured-json-reporter
```
In your `karma.conf.js` add
- `'karma-structured-json-reporter'` to your plugins
- `'json-result'` to your reporters
```
plugins: [
...
'karma-json-result-reporter',
...
];
reporters: [
'json'
...
],
```
## Configuration
Use the following config to output your JSON file.
```
jsonResultReporter: {
outputFile: "karma-result.json",
isSynchronous: true (optional, default false)
}
```
If no output file is specified the objects are logged to stdout.
------------------------
_karma-structured-json-reporter is a fork of [karma-json-result-reporter](https://github.com/Angular-cz/karma-json-result-reporter)_

@@ -0,0 +0,0 @@ const os = require('os');

@@ -0,0 +0,0 @@ {

Sorry, the diff of this file is not supported yet

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