Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #10 reporter showing undefined on startup #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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