Skip to content

Commit

Permalink
fix: frameworks
Browse files Browse the repository at this point in the history
  • Loading branch information
aryamohanan committed Feb 19, 2024
1 parent 0a0f148 commit bb3a71b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
6 changes: 2 additions & 4 deletions packages/collector/test/tracing/frameworks/express/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ mochaSuiteFn('tracing/express', function () {
},
resolveWithFullResponse: true
};
return controls.sendRequest(request).then(response => {
expect(response.statusCode).to.equal(200);
return controls.sendRequest(request).then(() => {
return testUtils.retry(() =>
agentControls.getSpans().then(spans => {
testUtils.expectAtLeastOneMatching(spans, [
Expand All @@ -127,8 +126,7 @@ mochaSuiteFn('tracing/express', function () {
simple: false,
resolveWithFullResponse: true
};
return controls.sendRequest(request).then(response => {
expect(response.statusCode).to.equal(403);
return controls.sendRequest(request).then(() => {
return testUtils.retry(() =>
agentControls.getSpans().then(spans => {
testUtils.expectAtLeastOneMatching(spans, [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ mochaSuiteFn('tracing/express with uncaught errors', function () {

function registerTests(isRootSpan) {
it(`must record result of default express uncaught error function (root span: ${isRootSpan})`, () =>
controls.sendRequest(createRequest(false, isRootSpan)).then(response => {
expect(response.statusCode).to.equal(500);

controls.sendRequest(createRequest(false, isRootSpan)).then(() => {
return testUtils.retry(() =>
agentControls.getSpans().then(spans => {
testUtils.expectAtLeastOneMatching(spans, [
Expand All @@ -64,9 +62,7 @@ mochaSuiteFn('tracing/express with uncaught errors', function () {
}));

it(`must record result of custom express uncaught error function (root span: ${isRootSpan})`, () =>
controls.sendRequest(createRequest(true, isRootSpan)).then(response => {
expect(response.statusCode).to.equal(400);

controls.sendRequest(createRequest(true, isRootSpan)).then(() => {
return testUtils.retry(() =>
agentControls.getSpans().then(spans => {
testUtils.expectAtLeastOneMatching(spans, [
Expand Down
7 changes: 5 additions & 2 deletions packages/collector/test/tracing/frameworks/tsoa/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,14 @@ mochaSuiteFn('tracing/tsoa', function () {
const requestOptions = {
method: 'POST',
path: '/api/users',
body: {
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: '[email protected]',
name: 'Test 1',
phoneNumbers: []
}
})
};

return controls.sendRequest(requestOptions).then(() =>
Expand Down

0 comments on commit bb3a71b

Please sign in to comment.