@@ -300,6 +300,60 @@ describe('testRunWithHooks', function() {
300
300
} ) ) ;
301
301
} ) ;
302
302
303
+ it ( 'testRunner with command inside before' , function ( ) {
304
+ let testsPath = path . join ( __dirname , '../../sampletests/beforewithcommand/commandInsideBefore.js' ) ;
305
+ let globals = {
306
+ calls : 0 ,
307
+ reporter ( results ) {
308
+ assert . ok ( results . lastError instanceof Error ) ;
309
+
310
+ assert . strictEqual ( globals . calls , 6 ) ;
311
+ let result = results . modules . commandInsideBefore . completed ;
312
+ // assert.ok('demoTestSyncOne' in result);
313
+ assert . ok ( ! ( 'beforeEach' in result ) ) ;
314
+ assert . ok ( ! ( 'before' in result ) ) ;
315
+ assert . ok ( ! ( 'afterEach' in result ) ) ;
316
+ assert . ok ( ! ( 'after' in result ) ) ;
317
+ }
318
+ } ;
319
+
320
+
321
+ return runTests ( {
322
+ _source : [ testsPath ]
323
+ } , settings ( {
324
+ seleniumPort : 10195 ,
325
+ globals,
326
+ output_folder : false
327
+ } ) ) ;
328
+ } ) ;
329
+
330
+ it ( 'testRunner with command inside before with 0 parameters' , function ( ) {
331
+ let testsPath = path . join ( __dirname , '../../sampletests/beforewithcommand/commandInsideBeforeWithNoParams.js' ) ;
332
+ let globals = {
333
+ calls : 0 ,
334
+ reporter ( results ) {
335
+ assert . ok ( results . lastError instanceof Error ) ;
336
+
337
+ assert . strictEqual ( globals . calls , 6 ) ;
338
+ let result = results . modules . commandInsideBeforeWithNoParams . completed ;
339
+ // assert.ok('demoTestSyncOne' in result);
340
+ assert . ok ( ! ( 'beforeEach' in result ) ) ;
341
+ assert . ok ( ! ( 'before' in result ) ) ;
342
+ assert . ok ( ! ( 'afterEach' in result ) ) ;
343
+ assert . ok ( ! ( 'after' in result ) ) ;
344
+ }
345
+ } ;
346
+
347
+
348
+ return runTests ( {
349
+ _source : [ testsPath ]
350
+ } , settings ( {
351
+ seleniumPort : 10195 ,
352
+ globals,
353
+ output_folder : false
354
+ } ) ) ;
355
+ } ) ;
356
+
303
357
it ( 'testRunWithAsyncHooks' , function ( ) {
304
358
let testsPath = path . join ( __dirname , '../../sampletests/withasynchooks' ) ;
305
359
let globals = {
0 commit comments