@@ -80,8 +80,8 @@ describe('express tracing', () => {
8080
8181 test . each ( [ [ 'array1' ] , [ 'array5' ] ] ) (
8282 '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' )
8585 . expect ( {
8686 transaction : {
8787 transaction : 'GET /test/array1,/\\/test\\/array[2-9]/' ,
@@ -102,9 +102,10 @@ describe('express tracing', () => {
102102 } ,
103103 } ,
104104 } )
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+ } ,
108109 ) ;
109110
110111 test . each ( [
@@ -116,8 +117,8 @@ describe('express tracing', () => {
116117 [ 'arr55/required/lastParam' ] ,
117118 [ 'arr/requiredPath/optionalPath/' ] ,
118119 [ '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' )
121122 . expect ( {
122123 transaction : {
123124 transaction : 'GET /test/arr/:id,/\\/test\\/arr[0-9]*\\/required(path)?(\\/optionalPath)?\\/(lastParam)?/' ,
@@ -138,9 +139,10 @@ describe('express tracing', () => {
138139 } ,
139140 } ,
140141 } )
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+ } ) ;
144146
145147 describe ( 'request data' , ( ) => {
146148 test ( 'correctly captures JSON request data' , async ( ) => {
0 commit comments