🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

karma-json-log-reporter2

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

karma-json-log-reporter2

A simple Karma reporter for logging json messages from matchers and specs.

unpublished
latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

karma-json-log-reporter2

NPM version Build status

A simple Karma reporter for logging json messages from matchers and specs.

Installation

Install from NPM:

npm install karma-json-log-reporter2

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": [
		"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.

Keywords

json

FAQs

Package last updated on 10 Dec 2016

Did you know?

Socket

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