@@ -87,12 +87,25 @@ test('--shallow option', function (t) {
87
87
} ) ;
88
88
} , options ) ;
89
89
90
- test ( 'bad -f option' , function ( t ) {
91
- documentation ( [ 'build -f DOES-NOT-EXIST fixture/internal.input.js' ] , function ( err ) {
92
- t . ok ( err , 'returns error' ) ;
93
- t . end ( ) ;
94
- } ) ;
95
- } , options ) ;
90
+ test ( 'invalid arguments' , function ( group ) {
91
+ group . test ( 'bad -f option' , function ( t ) {
92
+ documentation ( [ 'build -f DOES-NOT-EXIST fixture/internal.input.js' ] , function ( err ) {
93
+ t . ok ( err , 'returns error' ) ;
94
+ t . end ( ) ;
95
+ } ) ;
96
+ } , options ) ;
97
+
98
+ group . test ( 'html with no destination' , function ( t ) {
99
+ documentation ( [ 'build -f html fixture/internal.input.js' ] , function ( err ) {
100
+ t . ok ( err . toString ( )
101
+ . match ( / T h e H T M L o u t p u t m o d e r e q u i r e s a d e s t i n a t i o n d i r e c t o r y s e t w i t h - o / ) ,
102
+ 'needs dest for html' ) ;
103
+ t . end ( ) ;
104
+ } ) ;
105
+ } , options ) ;
106
+
107
+ group . end ( ) ;
108
+ } ) ;
96
109
97
110
test ( '--version' , function ( t ) {
98
111
documentation ( [ '--version' ] , { } , function ( err , output ) {
@@ -101,35 +114,38 @@ test('--version', function (t) {
101
114
} , false ) ;
102
115
} , options ) ;
103
116
104
- test ( 'html with no destination' , function ( t ) {
105
- documentation ( [ 'build -f html fixture/internal.input.js' ] , function ( err ) {
106
- t . ok ( err . toString ( )
107
- . match ( / T h e H T M L o u t p u t m o d e r e q u i r e s a d e s t i n a t i o n d i r e c t o r y s e t w i t h - o / ) ,
108
- 'needs dest for html' ) ;
109
- t . end ( ) ;
110
- } ) ;
111
- } , options ) ;
117
+ test ( 'lint command' , function ( group ) {
112
118
113
- test ( '-- lint option ' , function ( t ) {
114
- documentation ( [ 'lint fixture/lint/lint.input.js' ] , function ( err , data ) {
115
- var output = path . join ( __dirname , 'fixture/lint/lint.output.js' ) ;
116
- data = data . toString ( ) . split ( '\n' ) . slice ( 2 ) . join ( '\n' ) ;
117
- if ( process . env . UPDATE ) {
118
- fs . writeFileSync ( output , data ) ;
119
- }
120
- t . equal ( err . code , 1 ) ;
121
- t . equal ( data , fs . readFileSync ( output , 'utf8' ) , 'outputs lint' ) ;
122
- t . end ( ) ;
123
- } ) ;
124
- } , options ) ;
119
+ group . test ( 'generates lint output ' , function ( t ) {
120
+ documentation ( [ 'lint fixture/lint/lint.input.js' ] , function ( err , data ) {
121
+ var output = path . join ( __dirname , 'fixture/lint/lint.output.js' ) ;
122
+ data = data . toString ( ) . split ( '\n' ) . slice ( 2 ) . join ( '\n' ) ;
123
+ if ( process . env . UPDATE ) {
124
+ fs . writeFileSync ( output , data ) ;
125
+ }
126
+ t . equal ( err . code , 1 ) ;
127
+ t . equal ( data , fs . readFileSync ( output , 'utf8' ) , 'outputs lint' ) ;
128
+ t . end ( ) ;
129
+ } ) ;
130
+ } , options ) ;
125
131
126
- test ( '--lint option on good file' , function ( t ) {
127
- documentation ( [ 'lint fixture/simple.input.js' ] , { } , function ( err , data ) {
128
- t . equal ( err , null ) ;
129
- t . equal ( data , '' , 'no output' ) ;
130
- t . end ( ) ;
131
- } , false ) ;
132
- } , options ) ;
132
+ group . test ( 'generates no output on a good file' , function ( t ) {
133
+ documentation ( [ 'lint fixture/simple.input.js' ] , { } , function ( err , data ) {
134
+ t . equal ( err , null ) ;
135
+ t . equal ( data , '' , 'no output' ) ;
136
+ t . end ( ) ;
137
+ } , false ) ;
138
+ } , options ) ;
139
+
140
+ group . test ( 'exposes syntax error on a bad file' , function ( t ) {
141
+ documentation ( [ 'lint fixture/bad/syntax.input.js' ] , { } , function ( err , data ) {
142
+ t . ok ( err . code > 0 , 'exits with a > 0 exit code' ) ;
143
+ t . end ( ) ;
144
+ } , false ) ;
145
+ } , options ) ;
146
+
147
+ group . end ( ) ;
148
+ } ) ;
133
149
134
150
test ( 'given no files' , function ( t ) {
135
151
documentation ( [ 'build' ] , function ( err ) {
0 commit comments