File tree Expand file tree Collapse file tree
javascript/node/selenium-webdriver/testing Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,17 +92,26 @@ function seal(fn) {
9292function wrapped ( globalFn ) {
9393 return function ( ) {
9494 if ( arguments . length === 1 ) {
95- return globalFn ( makeAsyncTestFn ( arguments [ 0 ] ) ) ;
96- }
97- else if ( arguments . length === 2 ) {
98- return globalFn ( arguments [ 0 ] , makeAsyncTestFn ( arguments [ 1 ] ) ) ;
99- }
100- else {
95+ return globalFn ( wrapArgument ( arguments [ 0 ] ) ) ;
96+
97+ } else if ( arguments . length === 2 ) {
98+ return globalFn ( arguments [ 0 ] , wrapArgument ( arguments [ 1 ] ) ) ;
99+
100+ } else {
101101 throw Error ( 'Invalid # arguments: ' + arguments . length ) ;
102102 }
103103 } ;
104104}
105105
106+
107+ function wrapArgument ( value ) {
108+ if ( typeof value === 'function' ) {
109+ return makeAsyncTestFn ( value ) ;
110+ }
111+ return value ;
112+ }
113+
114+
106115/**
107116 * Make a wrapper to invoke caller's test function, fn. Run the test function
108117 * within a ControlFlow.
You can’t perform that action at this time.
0 commit comments