Skip to content

Commit

Permalink
unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tianchu committed Oct 8, 2021
1 parent d7b5100 commit 4006cd1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/dd-trace/test/plugins/util/web.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@ describe('plugins/util/web', () => {
})
})

it('should set the parent from the active context if any', () => {
const parentSpan = tracer.startSpan('aws.lambda')

web.instrument(tracer, config, req, res, 'test.request', span => {
expect(span.context()._traceId.toString(10)).to.equal(parentSpan.context()._traceId.toString(10))
expect(span.context()._parentId.toString(10)).to.equal(parentSpan.context()._spanId.toString(10))
})
})

it('should set the service name', () => {
config.service = 'custom'

Expand Down

0 comments on commit 4006cd1

Please sign in to comment.