Code coverage report for preceptor-reporter/lib/reporter/json.js

Statements: 88.89% (8 / 9)      Branches: 50% (2 / 4)      Functions: 100% (2 / 2)      Lines: 88.89% (8 / 9)      Ignored: none     

All files » preceptor-reporter/lib/reporter/ » json.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43      1             1                 3   3 3   3                         4       1  
// Copyright 2014, Yahoo! Inc.
// Copyrights licensed under the Mit License. See the accompanying LICENSE file for terms.
 
var AbstractReporter = require('../abstractReporter');
 
/**
 * @class JsonReporter
 * @extends AbstractReporter
 * @constructor
 */
var JsonReporter = AbstractReporter.extend(
 
	{
		/**
		 * Initializes the instance
		 *
		 * @method initialize
		 */
		initialize: function () {
			this.__super();
 
			Eif (this.getOptions().progress === undefined) {
				this.getOptions().progress = false;
			}
			Iif (this.getOptions().output === undefined) {
				this.getOptions().output = false;
			}
		},
 
 
		/**
		 * Gets the collected output
		 *
		 * @method getOutput
		 * @return {string}
		 */
		getOutput: function () {
			return JSON.stringify(this.getContainer().getTree(), null, 4) + "\n";
		}
	});
 
module.exports = JsonReporter;