@@ -180,4 +180,56 @@ describe('options', function () {
180
180
} ) ;
181
181
} ) ;
182
182
} ) ;
183
+
184
+ describe ( '--forbid-only' , function ( ) {
185
+ before ( function ( ) {
186
+ args = [ '--forbid-only' ] ;
187
+ } ) ;
188
+
189
+ it ( 'succeeds if there are only passed tests' , function ( done ) {
190
+ run ( 'options/forbid-only/passed.js' , args , function ( err , res ) {
191
+ assert ( ! err ) ;
192
+ assert . equal ( res . code , 0 ) ;
193
+ done ( ) ;
194
+ } ) ;
195
+ } ) ;
196
+
197
+ it ( 'fails if there are tests marked only' , function ( done ) {
198
+ run ( 'options/forbid-only/only.js' , args , function ( err , res ) {
199
+ assert ( ! err ) ;
200
+ assert . equal ( res . code , 1 ) ;
201
+ done ( ) ;
202
+ } ) ;
203
+ } ) ;
204
+ } ) ;
205
+
206
+ describe ( '--forbid-pending' , function ( ) {
207
+ before ( function ( ) {
208
+ args = [ '--forbid-pending' ] ;
209
+ } ) ;
210
+
211
+ it ( 'succeeds if there are only passed tests' , function ( done ) {
212
+ run ( 'options/forbid-pending/passed.js' , args , function ( err , res ) {
213
+ assert ( ! err ) ;
214
+ assert . equal ( res . code , 0 ) ;
215
+ done ( ) ;
216
+ } ) ;
217
+ } ) ;
218
+
219
+ it ( 'fails if there are tests marked skip' , function ( done ) {
220
+ run ( 'options/forbid-pending/skip.js' , args , function ( err , res ) {
221
+ assert ( ! err ) ;
222
+ assert . equal ( res . code , 1 ) ;
223
+ done ( ) ;
224
+ } ) ;
225
+ } ) ;
226
+
227
+ it ( 'fails if there are pending tests' , function ( done ) {
228
+ run ( 'options/forbid-pending/pending.js' , args , function ( err , res ) {
229
+ assert ( ! err ) ;
230
+ assert . equal ( res . code , 1 ) ;
231
+ done ( ) ;
232
+ } ) ;
233
+ } ) ;
234
+ } ) ;
183
235
} ) ;
0 commit comments