karma-structured-json-reporter
Advanced tools
Comparing version 0.6.0 to 0.6.1
{ | ||
"name": "karma-structured-json-reporter", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Full karma test results as json file", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,78 +5,4 @@ # Karma Structured JSON Reporter | ||
**README file to be changed...** | ||
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](https://github.com/mackstar/karma-spec-json-reporter)_ | ||
See example folder for time being. |
8601
8