This package has been deprecated

Author message:

Please use karma-json-log-reporter instead.

vui-karma-json-log-reporter

0.0.2 • Public • Published

vui-karma-json-log-reporter

NPM version Build status

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.dump( JSON.stringify( obj ) );
 
console.log( JSON.stringify( obj ) );

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.dump( JSON.stringify( obj ) );

Note: if the target file exists with an object, the new object is merged with the existing object and the existing file is updated.

/vui-karma-json-log-reporter/

    Package Sidebar

    Install

    npm i vui-karma-json-log-reporter

    Weekly Downloads

    1

    Version

    0.0.2

    License

    Apache-2.0

    Last publish

    Collaborators

    • d2l-travis-deploy