|
2 | 2 | var sys = require('sys');
|
3 | 3 |
|
4 | 4 | var options = {};
|
5 |
| -var stylize = require('vows/console').stylize, |
6 |
| - puts = require('vows/console').puts(options); |
| 5 | +var console = require('vows/console'); |
| 6 | +var stylize = console.stylize, |
| 7 | + puts = console.puts(options); |
7 | 8 | //
|
8 | 9 | // Console reporter
|
9 | 10 | //
|
10 | 11 | var stream, buffer, messages = [];
|
11 | 12 |
|
| 13 | +this.name = 'dot-matrix'; |
12 | 14 | this.report = function (data, s) {
|
13 | 15 | var event = data[1];
|
14 | 16 |
|
@@ -46,24 +48,13 @@ this.report = function (data, s) {
|
46 | 48 | sys.print(' ');
|
47 | 49 | break;
|
48 | 50 | case 'finish':
|
49 |
| - var result = event.honored + " honored, " + |
50 |
| - event.broken + " broken, " + |
51 |
| - event.errored + " errored", |
52 |
| - style = event.honored === event.total ? ('green') |
53 |
| - : (event.errored === 0 ? 'yellow' : 'red'); |
54 |
| - |
55 | 51 | if (messages.length) {
|
56 | 52 | messages.pop(); // drop trailing blank message
|
57 | 53 | puts('\n\n' + messages.join('\n'));
|
58 | 54 | } else {
|
59 | 55 | sys.print('\n');
|
60 | 56 | }
|
61 |
| - |
62 |
| - if ('time' in event) { |
63 |
| - puts("\nVerified " + event.total + " vows in " + |
64 |
| - (event.time + " seconds.\n")); |
65 |
| - } |
66 |
| - puts(stylize(result, style)); |
| 57 | + puts(console.result(event).join('\n')); |
67 | 58 | break;
|
68 | 59 | case 'error':
|
69 | 60 | puts('\n\n * ' + stylize(event.error, 'red'));
|
|
0 commit comments