File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed
Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ function createHarness(conf_) {
107107 var only = false ;
108108 test . only = function ( ) {
109109 if ( only ) { throw new Error ( 'there can only be one only test' ) ; }
110- if ( conf_ . noOnly ) { throw new Error ( '`only` tests are prohibited' ) ; }
110+ if ( conf_ && conf_ . noOnly ) { throw new Error ( '`only` tests are prohibited' ) ; }
111111 only = true ;
112112 var t = test . apply ( null , arguments ) ;
113113 results . only ( t ) ;
Original file line number Diff line number Diff line change 33var tape = require ( '../' ) ;
44var tap = require ( 'tap' ) ;
55
6- tap . test ( 'main harness object is exposed' , function ( assert ) {
6+ tap . test ( 'main harness object is exposed' , function ( tt ) {
7+ tt . equal ( typeof tape . getHarness , 'function' , 'tape.getHarness is a function' ) ;
78
8- assert . equal ( typeof tape . getHarness , 'function' , 'tape.getHarness is a function' ) ;
9-
10- assert . equal ( tape . getHarness ( ) . _results . pass , 0 ) ;
11-
12- assert . end ( ) ;
9+ tt . equal ( tape . getHarness ( ) . _results . pass , 0 ) ;
1310
11+ tt . end ( ) ;
1412} ) ;
Original file line number Diff line number Diff line change @@ -46,3 +46,11 @@ tap.test('tape only test', function (tt) {
4646 t . end ( ) ;
4747 } ) ;
4848} ) ;
49+
50+ tap . test ( 'created harness with no conf' , function ( tt ) {
51+ var harness = tape . createHarness ( ) ;
52+
53+ tt . doesNotThrow ( function ( ) { harness . only ( { skip : true } ) ; } , 'harness.only does not throw with omitted harness conf arg' ) ;
54+
55+ tt . end ( ) ;
56+ } ) ;
You can’t perform that action at this time.
0 commit comments