Skip to content

Conversation

@jamestalmage
Copy link
Contributor

Add a spinner to the mini reporter to indicate ongoing test progress.

Fixes #598.

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @sotojuan, @naptowncode and @ivogabe to be potential reviewers

@jamestalmage
Copy link
Contributor Author

ava-spinner-demo

I ran all the visual tests and they all look good on iTerm2, OSX El Capitan.

@sotojuan
Copy link
Contributor

sotojuan commented Mar 3, 2016

This is awesome, thanks!

};

MiniReporter.prototype.clearInterval = function () {
if (this.interval) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there really any point in guarding this? clearInterval gracefully accepts anything.

@sindresorhus
Copy link
Member

Now the test title and the total count (71 passed) is vertically unaligned. They should be aligned.

this.currentStatus = '';
this.currentTest = '';
this.statusLineCount = 0;
this.spinnerFrame = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spinnerIndex would be a better name. When it says spinnerFrame I thought it was the actual frame.

@sindresorhus
Copy link
Member

While you're at it, can you put a linebreak above the test title to give it some breathing-room?

if (this.interval) {
clearInterval(this.interval);
}
this.interval = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reset to null since Node uses object refs?

@jamestalmage
Copy link
Contributor Author

Should pass / fail count be on the same line?

A:

screenshot 2016-03-05 21 40 58

vs.

B:

screenshot 2016-03-05 21 40 00

@jamestalmage
Copy link
Contributor Author

OK,
I incorporated most of the PR feedback.

Also, I switched it to option A as described above (counts on separate lines). That is the last commit, so it can be dropped if there is not agreement.

Add a spinner to the mini reporter to indicate ongoing test progress.

Fixes avajs#598.
verifies behavior when there are some passing / some failing
@sindresorhus
Copy link
Member

One more minor tweak. Move the spinner one char to the right without moving anything else. It's a bit too far from the test title and a bit too much crammed into the left edge.

⠋ test title => ⠋ test title

@sindresorhus
Copy link
Member

I'm good with A, but will let @vdemedes chime in.

status += ' ' + colors.error(this.failCount, 'failed');
if (this.passCount > 0) {
status += '\n';
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't you need to do this for skipped and todo tests results too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call on todo. I implemented this before rebasing, so yeah - that almost certainly needs a fix.

Are skipped tests shown yet? I thought there was still a pending PR for that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh - and I also missed everything in final

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, with master:

screen shot 2016-03-06 at 14 49 01

@vadimdemedes
Copy link
Contributor

I'm also ok with A (assuming all other counters will be updated too).

@jamestalmage
Copy link
Contributor Author

All changes made.

self.spinnerIndex = (self.spinnerIndex + 1) % self.spinnerFrames.length;
self.write(self.prefix());
}, this.spinnerInterval);
return this.prefix('');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The '' seems unnecessary here.

@novemberborn
Copy link
Member

Cool!

@sindresorhus sindresorhus changed the title Add busy indicator to mini reporter. Fixes #598. Add busy indicator to mini reporter Mar 8, 2016
@sindresorhus
Copy link
Member

The default reporter looks so beautiful now 😍. Thanks James :)

@jamestalmage jamestalmage deleted the busy-indicator branch April 6, 2016 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants