Skip to content

Commit

Permalink
fixes abdulhannanali#10 reporter showing undefined on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Zach Stoltz committed Nov 6, 2018
1 parent 28f121b commit 4a0da6f
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions nyanReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ class NyanReporter {
* Options aren't directly passed to the NyanReporter
* but are instead passed through Jest. We specify the options in the
* jest configuration and as a result they are passed to us
*
*
* Following options are supported with Jest right now:
*
*
* - suppressErrorReporter
* If this is `true` the Error reporter isn't showed in case tests fail.
*
*
* - renderOnRunCompletely
* If true, the output is only rendered when the run completes successfully
*
* If true, the output is only rendered when the run completes successfully
*
* @constructor
*/
constructor(options = {}) {
Expand Down Expand Up @@ -75,7 +75,7 @@ class NyanReporter {
}
}

/**
/**
* Generate rainbow colors
*
* @private
Expand All @@ -100,11 +100,11 @@ class NyanReporter {
numPendingTests,
numTotalTests,
}) {
this.drawType('total tests', numTotalTests);
this.drawType('green', numPassedTests);
this.drawType('fail', numFailedTests);
this.drawType('pending', numPendingTests);
this.drawType('total tests', numTotalTests || 0);
this.drawType('green', numPassedTests || 0);
this.drawType('fail', numFailedTests || 0);
this.drawType('pending', numPendingTests || 0);

this.cursorUp(this.numberOfLines);
}

Expand All @@ -120,7 +120,7 @@ class NyanReporter {
/**
* Append the rainbow.
* @private
*
*
* @param {string} str
* @return {string}
*/
Expand Down Expand Up @@ -151,7 +151,7 @@ class NyanReporter {

/**
* Draw the Nyan Cat
*
*
* @private
*/
drawNyanCat(results) {
Expand Down Expand Up @@ -219,7 +219,7 @@ class NyanReporter {

/**
* Move cursor up `n`
*
*
* @private
* @param {number} n
*/
Expand Down

0 comments on commit 4a0da6f

Please sign in to comment.