Skip to content

Commit fac8988

Browse files
authored
fix wrong test error message when expected span was not received (#5447)
1 parent 402741b commit fac8988

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/dd-trace/test/plugins/helpers.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict'
22

33
const { AssertionError } = require('assert')
4+
const { inspect } = require('util')
45
const { AsyncResource } = require('../../../datadog-instrumentations/src/helpers/instrument')
56

67
const Nomenclature = require('../../src/service-naming')
@@ -33,7 +34,7 @@ function expectSomeSpan (agent, expected, timeout) {
3334
const error = scoredErrors.sort((a, b) => a.score - b.score)[0].err
3435
// We'll append all the spans to this error message so it's visible in test
3536
// output.
36-
error.message += '\n\nCandidate Traces:\n' + JSON.stringify(traces, null, 2)
37+
error.message += '\n\nCandidate Traces:\n' + inspect(traces)
3738
throw error
3839
}, timeout)
3940
}

0 commit comments

Comments
 (0)