@@ -25,17 +25,23 @@ function seal(fn) {
25
25
* @param {!Function } globalFn The function to wrap.
26
26
* @return {!Function } The new function.
27
27
*/
28
- function wrapInControlFlow ( globalFn ) {
28
+ function wrapInControlFlow ( globalFn , fnName ) {
29
29
return function ( ) {
30
30
var driverError = new Error ( ) ;
31
31
driverError . stack = driverError . stack . replace ( / + a t .+ j a s m i n e w d .+ \n / , '' ) ;
32
32
33
+ var description = 'Asynchronous test function: ' + fnName + '(' ;
34
+ if ( arguments . length >= 2 ) {
35
+ description += '"' + arguments [ 0 ] + '"' ;
36
+ }
37
+ description += ')' ;
38
+
33
39
function asyncTestFn ( fn ) {
34
40
return function ( done ) {
35
41
var thing = flow . execute ( function ( ) {
36
42
fn . call ( jasmine . getEnv ( ) . currentSpec ) ;
37
- } , 'asynchronous test function' ) . then ( seal ( done ) , function ( e ) {
38
- e . stack = driverError . stack + '\nAt async task:\n ' + e . stack ;
43
+ } , description ) . then ( seal ( done ) , function ( e ) {
44
+ e . stack = e . stack + '==== async task ====\n ' + driverError . stack ;
39
45
done ( e ) ;
40
46
} ) ;
41
47
} ;
@@ -62,10 +68,10 @@ function wrapInControlFlow(globalFn) {
62
68
} ;
63
69
} ;
64
70
65
- global . it = wrapInControlFlow ( global . it ) ;
66
- global . iit = wrapInControlFlow ( global . iit ) ;
67
- global . beforeEach = wrapInControlFlow ( global . beforeEach ) ;
68
- global . afterEach = wrapInControlFlow ( global . afterEach ) ;
71
+ global . it = wrapInControlFlow ( global . it , 'it' ) ;
72
+ global . iit = wrapInControlFlow ( global . iit , 'iit' ) ;
73
+ global . beforeEach = wrapInControlFlow ( global . beforeEach , 'beforeEach' ) ;
74
+ global . afterEach = wrapInControlFlow ( global . afterEach , 'afterEach' ) ;
69
75
70
76
71
77
/**
0 commit comments