Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
khanayan123 committed Feb 12, 2025
1 parent 71d6930 commit 744fdde
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion integration-tests/pino/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const logger = require('pino')()
const server = http
.createServer((req, res) => {
const span = tracer.scope().active()
const contextTraceId = span.context().toTraceId()
const contextTraceId = span.context().toTraceId(true)
const contextSpanId = span.context().toSpanId()
logger.info(
{ custom: { trace_id: contextTraceId, span_id: contextSpanId } },
Expand Down
2 changes: 1 addition & 1 deletion packages/datadog-plugin-bunyan/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('Plugin', () => {
const record = JSON.parse(stream.write.firstCall.args[0].toString())

expect(record.dd).to.deep.include({
trace_id: span.context().toTraceId(),
trace_id: span.context().toTraceId(true),
span_id: span.context().toSpanId()
})
})
Expand Down
6 changes: 3 additions & 3 deletions packages/datadog-plugin-pino/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ describe('Plugin', () => {
const record = JSON.parse(stream.write.firstCall.args[0].toString())

expect(record.dd).to.deep.include({
trace_id: span.context().toTraceId(),
trace_id: span.context().toTraceId(true),
span_id: span.context().toSpanId()
})

Expand Down Expand Up @@ -184,7 +184,7 @@ describe('Plugin', () => {
const record = JSON.parse(stream.write.firstCall.args[0].toString())

expect(record.dd).to.deep.include({
trace_id: span.context().toTraceId(),
trace_id: span.context().toTraceId(true),
span_id: span.context().toSpanId()
})

Expand All @@ -207,7 +207,7 @@ describe('Plugin', () => {

const record = stream.write.firstCall.args[0].toString()

expect(record).to.match(new RegExp(`trace_id\\W+?${span.context().toTraceId()}`))
expect(record).to.match(new RegExp(`trace_id\\W+?${span.context().toTraceId(true)}`))
expect(record).to.match(new RegExp(`span_id\\W+?${span.context().toSpanId()}`))

expect(record).to.include('message')
Expand Down
12 changes: 6 additions & 6 deletions packages/datadog-plugin-winston/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ describe('Plugin', () => {
it('should not alter the default behavior', () => {
const meta = {
dd: {
trace_id: span.context().toTraceId(),
trace_id: span.context().toTraceId(true),
span_id: span.context().toSpanId()
}
}
Expand Down Expand Up @@ -150,7 +150,7 @@ describe('Plugin', () => {
it('should add the trace identifiers to the default logger', async () => {
const meta = {
dd: {
trace_id: span.context().toTraceId(),
trace_id: span.context().toTraceId(true),
span_id: span.context().toSpanId()
}
}
Expand All @@ -170,7 +170,7 @@ describe('Plugin', () => {

const meta = {
dd: {
trace_id: span.context().toTraceId(),
trace_id: span.context().toTraceId(true),
span_id: span.context().toSpanId()
}
}
Expand All @@ -190,7 +190,7 @@ describe('Plugin', () => {
it('should support errors', async () => {
const meta = {
dd: {
trace_id: span.context().toTraceId(),
trace_id: span.context().toTraceId(true),
span_id: span.context().toSpanId()
}
}
Expand All @@ -216,7 +216,7 @@ describe('Plugin', () => {
transports: [transport, httpTransport]
})
const dd = {
trace_id: span.context().toTraceId(),
trace_id: span.context().toTraceId(true),
span_id: span.context().toSpanId()
}

Expand Down Expand Up @@ -287,7 +287,7 @@ describe('Plugin', () => {

const meta = {
dd: {
trace_id: span.context().toTraceId(),
trace_id: span.context().toTraceId(true),
span_id: span.context().toSpanId()
}
}
Expand Down

0 comments on commit 744fdde

Please sign in to comment.