Skip to content

Commit

Permalink
print a different cue when running tests in watch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhead committed Jun 9, 2010
1 parent c533efa commit df83078
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions bin/vows
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,14 @@ if (args.length > 0) {
// Watch mode
//
(function () {
var clock = [
var pendulum = [
'. ', '.. ', '... ', ' ...',
' ..', ' .', ' .', ' ..',
'... ', '.. ', '. '
];
var strobe = ['.', ' '];
var status,
cue,
current = 0,
testFolder,
running = 0,
Expand Down Expand Up @@ -141,14 +143,18 @@ if (args.length > 0) {

// Run every 100ms
function tick() {
if (running) { return }
if (running && (cue !== strobe)) {
cue = strobe, current = 0;
} else if (!running && (cue !== pendulum)) {
cue = pendulum, current = 0;
}

cursorSave();
eraseLine();
lastRun && esc(colors[status.errored ? 2 : (status.broken ? 1 : 0)]);
print(clock[current]);
lastRun && !running && esc(colors[status.errored ? 2 : (status.broken ? 1 : 0)]);
print(cue[current]);

if (current == clock.length - 1) { current = -1 }
if (current == cue.length - 1) { current = -1 }

current ++;
esc('39m');
Expand Down

0 comments on commit df83078

Please sign in to comment.