Skip to content

Commit 736addf

Browse files
committed
fix tests
1 parent 20c9433 commit 736addf

File tree

2 files changed

+23
-30
lines changed
  • dev-packages/node-integration-tests/suites/express

2 files changed

+23
-30
lines changed

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

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ describe('express tracing', () => {
160160
})
161161
.start(done);
162162

163-
runner.makeRequest('post', '/test-post', {}, { foo: 'bar', other: 1 });
163+
runner.makeRequest('post', '/test-post', { data: { foo: 'bar', other: 1 } });
164164
});
165165

166166
test('correctly captures plain text request data', done => {
@@ -181,14 +181,10 @@ describe('express tracing', () => {
181181
})
182182
.start(done);
183183

184-
runner.makeRequest(
185-
'post',
186-
'/test-post',
187-
{
188-
'Content-Type': 'text/plain',
189-
},
190-
'some plain text',
191-
);
184+
runner.makeRequest('post', '/test-post', {
185+
headers: { 'Content-Type': 'text/plain' },
186+
data: 'some plain text',
187+
});
192188
});
193189

194190
test('correctly captures text buffer request data', done => {
@@ -209,12 +205,10 @@ describe('express tracing', () => {
209205
})
210206
.start(done);
211207

212-
runner.makeRequest(
213-
'post',
214-
'/test-post',
215-
{ 'Content-Type': 'application/octet-stream' },
216-
Buffer.from('some plain text in buffer'),
217-
);
208+
runner.makeRequest('post', '/test-post', {
209+
headers: { 'Content-Type': 'application/octet-stream' },
210+
data: Buffer.from('some plain text in buffer'),
211+
});
218212
});
219213

220214
test('correctly captures non-text buffer request data', done => {
@@ -238,7 +232,10 @@ describe('express tracing', () => {
238232

239233
const body = new Uint8Array([1, 2, 3, 4, 5]).buffer;
240234

241-
runner.makeRequest('post', '/test-post', { 'Content-Type': 'application/octet-stream' }, body);
235+
runner.makeRequest('post', '/test-post', {
236+
headers: { 'Content-Type': 'application/octet-stream' },
237+
data: body,
238+
});
242239
});
243240
});
244241
});

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

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe('express without tracing', () => {
5252
})
5353
.start(done);
5454

55-
runner.makeRequest('post', '/test-post', {}, { foo: 'bar', other: 1 });
55+
runner.makeRequest('post', '/test-post', { data: { foo: 'bar', other: 1 } });
5656
});
5757

5858
test('correctly captures plain text request data', done => {
@@ -73,14 +73,12 @@ describe('express without tracing', () => {
7373
})
7474
.start(done);
7575

76-
runner.makeRequest(
77-
'post',
78-
'/test-post',
79-
{
76+
runner.makeRequest('post', '/test-post', {
77+
headers: {
8078
'Content-Type': 'text/plain',
8179
},
82-
'some plain text',
83-
);
80+
data: 'some plain text',
81+
});
8482
});
8583

8684
test('correctly captures text buffer request data', done => {
@@ -101,12 +99,10 @@ describe('express without tracing', () => {
10199
})
102100
.start(done);
103101

104-
runner.makeRequest(
105-
'post',
106-
'/test-post',
107-
{ 'Content-Type': 'application/octet-stream' },
108-
Buffer.from('some plain text in buffer'),
109-
);
102+
runner.makeRequest('post', '/test-post', {
103+
headers: { 'Content-Type': 'application/octet-stream' },
104+
data: Buffer.from('some plain text in buffer'),
105+
});
110106
});
111107

112108
test('correctly captures non-text buffer request data', done => {
@@ -130,7 +126,7 @@ describe('express without tracing', () => {
130126

131127
const body = new Uint8Array([1, 2, 3, 4, 5]).buffer;
132128

133-
runner.makeRequest('post', '/test-post', { 'Content-Type': 'application/octet-stream' }, body);
129+
runner.makeRequest('post', '/test-post', { headers: { 'Content-Type': 'application/octet-stream' }, data: body });
134130
});
135131
});
136132
});

0 commit comments

Comments
 (0)