File tree 4 files changed +29
-6
lines changed
4 files changed +29
-6
lines changed Original file line number Diff line number Diff line change 17
17
//
18
18
var path = require ( 'path' ) ,
19
19
events = require ( 'events' ) ,
20
+ util = require ( 'util' ) ,
20
21
vows = exports ;
21
22
22
23
// Options
@@ -122,7 +123,7 @@ function addVow(vow) {
122
123
var after = vow . binding . context . after ;
123
124
// only need to check order. I won't get here if the after event
124
125
// has never been emitted
125
- if ( self . _vowsEmitedEventsOrder . indexOf ( after ) >
126
+ if ( self . _vowsEmitedEventsOrder . indexOf ( after ) >
126
127
self . _vowsEmitedEventsOrder . indexOf ( event ) ) {
127
128
output ( 'broken' , event + ' emitted before ' + after ) ;
128
129
return ;
@@ -184,7 +185,7 @@ process.on('exit', function () {
184
185
}
185
186
} ) ;
186
187
187
- if ( unFired . length > 0 ) { console . log ( ) ; }
188
+ if ( unFired . length > 0 ) { util . print ( '\n' ) ; }
188
189
189
190
unFired . forEach ( function ( title ) {
190
191
s . reporter . report ( [ 'error' , {
@@ -204,7 +205,7 @@ process.on('exit', function () {
204
205
} ) ;
205
206
} ) ;
206
207
if ( failure ) {
207
- console . log ( console . result ( results ) ) ;
208
+ util . puts ( console . result ( results ) ) ;
208
209
process . exit ( 1 ) ;
209
210
}
210
211
} ) ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ this.stylize = function stylize(str, style) {
5
5
if ( module . exports . nocolor ) {
6
6
return str ;
7
7
}
8
-
8
+
9
9
var styles = {
10
10
'bold' : [ 1 , 22 ] ,
11
11
'italic' : [ 3 , 23 ] ,
@@ -52,6 +52,8 @@ this.puts = function (options) {
52
52
} ;
53
53
} ;
54
54
55
+ this . log = this . puts ( { } ) ;
56
+
55
57
this . result = function ( event ) {
56
58
var result = [ ] , buffer = [ ] , time = '' , header ;
57
59
var complete = event . honored + event . pending + event . errored + event . broken ;
@@ -93,7 +95,7 @@ this.inspect = function inspect(val) {
93
95
if ( module . exports . nocolor ) {
94
96
return eyes ( val ) ;
95
97
}
96
-
98
+
97
99
return '\033[1m' + eyes ( val ) + '\033[22m' ;
98
100
} ;
99
101
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ this.report = function (data) {
26
26
puts ( console . vowText ( event ) ) ;
27
27
break ;
28
28
case 'end' :
29
- console . log ( ) ;
29
+ this . print ( '\n' ) ;
30
30
break ;
31
31
case 'finish' :
32
32
puts ( console . result ( event ) . join ( '\n' ) ) ;
Original file line number Diff line number Diff line change
1
+ var vows = require ( './' ) ,
2
+ assert = require ( 'assert' ) ;
3
+
4
+ vows . describe ( 'basic-formulation' ) . addBatch ( {
5
+ "An invocation with no query string" : {
6
+ topic : function ( ) {
7
+ request . get ( "http://localhost:8080/something" , this . callback ) ;
8
+ } ,
9
+
10
+ "does not fail" : function ( error , response , body ) {
11
+ assert . notEqual ( true , error ) ;
12
+ } ,
13
+
14
+ "receives a response" : {
15
+ "with status 200" : function ( error , response , body ) {
16
+ assert . equal ( 200 , response . statusCode ) ;
17
+ }
18
+ }
19
+ }
20
+ } ) . export ( module ) ;
You can’t perform that action at this time.
0 commit comments