@@ -80,8 +80,8 @@ describe('express tracing', () => {
80
80
81
81
test . each ( [ [ 'array1' ] , [ 'array5' ] ] ) (
82
82
'should set a correct transaction name for routes consisting of arrays of routes for %p' ,
83
- ( ( segment : string , done : ( ) => void ) => {
84
- createRunner ( __dirname , 'server.js' )
83
+ async ( segment : string ) => {
84
+ const runner = await createRunner ( __dirname , 'server.js' )
85
85
. expect ( {
86
86
transaction : {
87
87
transaction : 'GET /test/array1,/\\/test\\/array[2-9]/' ,
@@ -102,9 +102,10 @@ describe('express tracing', () => {
102
102
} ,
103
103
} ,
104
104
} )
105
- . start ( done )
106
- . makeRequest ( 'get' , `/test/${ segment } ` ) ;
107
- } ) as any ,
105
+ . start ( ) ;
106
+ await runner . makeRequest ( 'get' , `/test/${ segment } ` ) ;
107
+ await runner . completed ( ) ;
108
+ } ,
108
109
) ;
109
110
110
111
test . each ( [
@@ -116,8 +117,8 @@ describe('express tracing', () => {
116
117
[ 'arr55/required/lastParam' ] ,
117
118
[ 'arr/requiredPath/optionalPath/' ] ,
118
119
[ 'arr/requiredPath/optionalPath/lastParam' ] ,
119
- ] ) ( 'should handle more complex regexes in route arrays correctly for %p' , ( ( segment : string , done : ( ) => void ) => {
120
- createRunner ( __dirname , 'server.js' )
120
+ ] ) ( 'should handle more complex regexes in route arrays correctly for %p' , async ( segment : string ) => {
121
+ const runner = await createRunner ( __dirname , 'server.js' )
121
122
. expect ( {
122
123
transaction : {
123
124
transaction : 'GET /test/arr/:id,/\\/test\\/arr[0-9]*\\/required(path)?(\\/optionalPath)?\\/(lastParam)?/' ,
@@ -138,9 +139,10 @@ describe('express tracing', () => {
138
139
} ,
139
140
} ,
140
141
} )
141
- . start ( done )
142
- . makeRequest ( 'get' , `/test/${ segment } ` ) ;
143
- } ) as any ) ;
142
+ . start ( ) ;
143
+ await runner . makeRequest ( 'get' , `/test/${ segment } ` ) ;
144
+ await runner . completed ( ) ;
145
+ } ) ;
144
146
145
147
describe ( 'request data' , ( ) => {
146
148
test ( 'correctly captures JSON request data' , async ( ) => {
0 commit comments