Skip to content
This repository has been archived by the owner on Dec 20, 2022. It is now read-only.

Use json-cycle to allow for circular references in json #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
'use strict'
var path = require('path')
var fs = require('fs')
var stringify = require('json-cycle').stringify

//
var JSONReporter = function (baseReporterDecorator, config, helper, logger) {
Expand Down Expand Up @@ -33,7 +34,7 @@ var JSONReporter = function (baseReporterDecorator, config, helper, logger) {

this.onRunComplete = function (browser, result) {
history.summary = result
var json = JSON.stringify(history, undefined, '\t')
var json = stringify(history, undefined, '\t')

if (stdout) {
process.stdout.write(json)
Expand Down
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,28 @@
"type": "git",
"url": "git://github.com/douglasduteil/karma-json-reporter.git"
},
"keywords": ["karma-plugin", "reporter", "json"],
"keywords": [
"karma-plugin",
"reporter",
"json"
],
"peerDependencies": {
"karma": ">=0.9"
},
"dependencies": {
"json-cycle": "^1.3.0"
},
"devDependencies": {
"chai": "^4.1.2",
"eslint": "^4.7.2",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.2.0",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1",
"eslint": "^4.7.2",
"karma": ">=0.9",
"karma-chrome-launcher": "^2.2.0",
"karma-mocha": "^1.3.0",
"karma": ">=0.9",
"mocha": "^3.5.3"
},
"author": "Douglas Duteil",
Expand Down