Skip to content

Commit 0b46cb6

Browse files
committed
remove done usages
1 parent 3032a21 commit 0b46cb6

File tree

2 files changed

+24
-20
lines changed
  • dev-packages/node-integration-tests/suites

2 files changed

+24
-20
lines changed

dev-packages/node-integration-tests/suites/express-v5/tracing/test.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ describe('express tracing', () => {
7979

8080
test.each([['array1'], ['array5']])(
8181
'should set a correct transaction name for routes consisting of arrays of routes for %p',
82-
((segment: string, done: () => void) => {
83-
createRunner(__dirname, 'server.js')
82+
async (segment: string) => {
83+
const runner = await createRunner(__dirname, 'server.js')
8484
.expect({
8585
transaction: {
8686
transaction: 'GET /test/array1,/\\/test\\/array[2-9]/',
@@ -101,9 +101,10 @@ describe('express tracing', () => {
101101
},
102102
},
103103
})
104-
.start(done)
105-
.makeRequest('get', `/test/${segment}`);
106-
}) as any,
104+
.start();
105+
await runner.makeRequest('get', `/test/${segment}`);
106+
await runner.completed();
107+
},
107108
);
108109

109110
test.each([
@@ -113,8 +114,8 @@ describe('express tracing', () => {
113114
['arr/requiredPath'],
114115
['arr/required/lastParam'],
115116
['arr55/required/lastParam'],
116-
])('should handle more complex regexes in route arrays correctly for %p', ((segment: string, done: () => void) => {
117-
createRunner(__dirname, 'server.js')
117+
])('should handle more complex regexes in route arrays correctly for %p', async (segment: string) => {
118+
const runner = await createRunner(__dirname, 'server.js')
118119
.expect({
119120
transaction: {
120121
transaction: 'GET /test/arr/:id,/\\/test\\/arr[0-9]*\\/required(path)?(\\/optionalPath)?\\/(lastParam)?/',
@@ -135,9 +136,10 @@ describe('express tracing', () => {
135136
},
136137
},
137138
})
138-
.start(done)
139-
.makeRequest('get', `/test/${segment}`);
140-
}) as any);
139+
.start();
140+
await runner.makeRequest('get', `/test/${segment}`);
141+
await runner.completed();
142+
});
141143

142144
describe('request data', () => {
143145
test('correctly captures JSON request data', async () => {

dev-packages/node-integration-tests/suites/express/tracing/test.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)