Skip to content

Commit

Permalink
test: updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
aryamohanan committed Dec 12, 2024
1 parent e550ead commit f27e6e5
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions packages/collector/test/tracing/cloud/aws-sdk/v2/dynamodb/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ mochaSuiteFn('tracing/cloud/aws-sdk/v2/dynamodb', function () {
]);
});
it('should not ignore spans for endpoints that are not in the ignore list', async () => {
const apiPath = `/createTable/${requestMethod}`;
const apiPath = `/scan/${requestMethod}`;

await appControls.sendRequest({
method: 'GET',
Expand All @@ -313,9 +313,22 @@ mochaSuiteFn('tracing/cloud/aws-sdk/v2/dynamodb', function () {
await delay(1000);
const spans = await agentControls.getSpans();

// 1 x http entry span
// 1 x http client span
// 1 x dynamodb span
expect(spans.length).to.equal(3);

expectAtLeastOneMatching(spans, [
span => expect(span.n).to.equal('dynamodb'),
span => expect(span.data.dynamodb.op).to.equal('create')
span => expect(span.data.dynamodb.op).to.equal('scan')
]);
expectAtLeastOneMatching(spans, [
span => expect(span.n).to.equal('node.http.server'),
span => expect(span.data.http.method).to.equal('GET')
]);
expectAtLeastOneMatching(spans, [
span => expect(span.n).to.equal('node.http.client'),
span => expect(span.data.http.method).to.equal('GET')
]);
});
});
Expand Down

0 comments on commit f27e6e5

Please sign in to comment.