Skip to content

Commit

Permalink
add sqs promise test
Browse files Browse the repository at this point in the history
  • Loading branch information
wconti27 committed Jun 21, 2024
1 parent 539df4a commit 8c16eea
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/datadog-plugin-aws-sdk/test/sqs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,25 @@ describe('Plugin', () => {
})
})

it('Should set pathway hash tag on a span when consuming and promise() was used over a callback',
async (done) => {
await sqs.sendMessage({ MessageBody: 'test DSM', QueueUrl: QueueUrlDsm }).promise()
await sqs.receiveMessage({ QueueUrl: QueueUrlDsm }).promise()

let consumeSpanMeta = {}
agent.use(traces => {
const span = traces[0][0]

if (span.name === 'aws.response') {
consumeSpanMeta = span.meta
}

expect(consumeSpanMeta).to.include({
'pathway.hash': expectedConsumerHash
})
}).then(done, done)
})

it('Should emit DSM stats to the agent when sending a message', done => {
agent.expectPipelineStats(dsmStats => {
let statsPointsReceived = 0
Expand Down

0 comments on commit 8c16eea

Please sign in to comment.