Skip to content

Commit

Permalink
test: assert startSpan spy called with name when only name and fn pas…
Browse files Browse the repository at this point in the history
…sed to startActiveSpan

Signed-off-by: naseemkullah <naseem@transit.app>
  • Loading branch information
naseemkullah committed May 28, 2021
1 parent c395c81 commit 4eb9d6c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/opentelemetry-tracing/test/Tracer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,11 @@ describe('Tracer', () => {
tracerProvider
);

const spy = sinon.spy(tracer, "startSpan");

assert.strictEqual(tracer.startActiveSpan('my-span', span => {
try {
assert(spy.calledWith('my-span'))
assert.strictEqual(getSpan(context.active()), span)
return 1
} finally {
Expand Down

0 comments on commit 4eb9d6c

Please sign in to comment.