File tree Expand file tree Collapse file tree 4 files changed +38
-38
lines changed Expand file tree Collapse file tree 4 files changed +38
-38
lines changed Original file line number Diff line number Diff line change @@ -97,3 +97,35 @@ this.error = function (obj) {
97
97
98
98
return string ;
99
99
} ;
100
+
101
+ this . contextText = function ( event ) {
102
+ return ' ' + event ;
103
+ } ;
104
+
105
+ this . vowText = function ( event ) {
106
+ var buffer = [ ] ;
107
+
108
+ buffer . push ( ' ' + {
109
+ honored : ' ✓ ' ,
110
+ broken : ' ✗ ' ,
111
+ errored : ' ✗ ' ,
112
+ pending : ' - '
113
+ } [ event . status ] + stylize ( event . title , ( {
114
+ honored : 'green' ,
115
+ broken : 'yellow' ,
116
+ errored : 'red' ,
117
+ pending : 'cyan'
118
+ } ) [ event . status ] ) ) ;
119
+
120
+ if ( event . status === 'broken' ) {
121
+ buffer . push ( ' » ' + event . exception ) ;
122
+ } else if ( event . status === 'errored' ) {
123
+ if ( event . exception . type === 'promise' ) {
124
+ buffer . push ( ' » ' + stylize ( "An unexpected error was caught: " +
125
+ stylize ( event . exception . error , 'bold' ) , 'red' ) ) ;
126
+ } else {
127
+ buffer . push ( ' ' + stylize ( event . exception , 'red' ) ) ;
128
+ }
129
+ }
130
+ return buffer . join ( '\n' ) ;
131
+ } ;
Original file line number Diff line number Diff line change @@ -37,10 +37,10 @@ this.report = function (data) {
37
37
}
38
38
if ( event . status === 'broken' ) {
39
39
puts ( stylize ( '✗' , 'yellow' ) ) ;
40
- messages . push ( spec . vowText ( event ) ) ;
40
+ messages . push ( console . vowText ( event ) ) ;
41
41
} else if ( event . status === 'errored' ) {
42
42
puts ( stylize ( '✗' , 'red' ) ) ;
43
- messages . push ( spec . vowText ( event ) ) ;
43
+ messages . push ( console . vowText ( event ) ) ;
44
44
}
45
45
messages . push ( '' ) ;
46
46
}
Original file line number Diff line number Diff line change @@ -22,10 +22,10 @@ this.report = function (data) {
22
22
puts ( '\n♢ ' + stylize ( event , 'bold' ) + '\n' ) ;
23
23
break ;
24
24
case 'context' :
25
- puts ( this . contextText ( event ) ) ;
25
+ puts ( console . contextText ( event ) ) ;
26
26
break ;
27
27
case 'vow' :
28
- puts ( this . vowText ( event ) ) ;
28
+ puts ( console . vowText ( event ) ) ;
29
29
break ;
30
30
case 'end' :
31
31
sys . print ( '\n' ) ;
@@ -39,38 +39,6 @@ this.report = function (data) {
39
39
}
40
40
} ;
41
41
42
- this . contextText = function ( event ) {
43
- return ' ' + event ;
44
- } ;
45
-
46
- this . vowText = function ( event ) {
47
- var buffer = [ ] ;
48
-
49
- buffer . push ( ' ' + {
50
- honored : ' ✓ ' ,
51
- broken : ' ✗ ' ,
52
- errored : ' ✗ ' ,
53
- pending : ' - '
54
- } [ event . status ] + stylize ( event . title , ( {
55
- honored : 'green' ,
56
- broken : 'yellow' ,
57
- errored : 'red' ,
58
- pending : 'cyan'
59
- } ) [ event . status ] ) ) ;
60
-
61
- if ( event . status === 'broken' ) {
62
- buffer . push ( ' » ' + event . exception ) ;
63
- } else if ( event . status === 'errored' ) {
64
- if ( event . exception . type === 'promise' ) {
65
- buffer . push ( ' » ' + stylize ( "An unexpected error was caught: " +
66
- stylize ( event . exception . error , 'bold' ) , 'red' ) ) ;
67
- } else {
68
- buffer . push ( ' ' + stylize ( event . exception , 'red' ) ) ;
69
- }
70
- }
71
- return buffer . join ( '\n' ) ;
72
- } ;
73
-
74
42
this . print = function ( str ) {
75
43
sys . print ( str ) ;
76
44
} ;
Original file line number Diff line number Diff line change @@ -25,9 +25,9 @@ this.report = function (data) {
25
25
if ( [ 'honored' , 'pending' ] . indexOf ( event . status ) === - 1 ) {
26
26
if ( lastContext !== event . context ) {
27
27
lastContext = event . context ;
28
- puts ( spec . contextText ( event . context ) ) ;
28
+ puts ( console . contextText ( event . context ) ) ;
29
29
}
30
- puts ( spec . vowText ( event ) ) ;
30
+ puts ( console . vowText ( event ) ) ;
31
31
puts ( '' ) ;
32
32
}
33
33
break ;
You can’t perform that action at this time.
0 commit comments