vui-karma-json-log-reporter
A simple Karma reporter for logging json messages from matchers and specs.
Installation
Install from NPM:
npm install vui-karma-json-log-reporter
Usage
Required Karma configuration includes typical wire-up via Karma plug-ins and reporters, and optionally specifying the destination path for JSON output:
"jsonLogReporter": "outputPath": "test/some/path/" "plugins": "vui-karma-json-log-reporter" "reporters": "json-log"
JSON logged via console.log and window.dump is sent to the default JSON file 'logFile_timestamp.json'.
window; console;
Alternatively, if an object is provided with a name and object, the object is logged to a file according to the specified name, ex. 'myObjectName.json'.
var obj = 'name': 'myObjectName' 'object': objectToLog; window;
Note: if the target file exists with an object, the new object is merged with the existing object and the existing file is updated.