Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: allow parent span to be null #569

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: undefined spans
dyladan committed Nov 27, 2019

Verified

This commit was signed with the committer’s verified signature.
dyladan Daniel Dyla
commit 9ee1491f61cbd28ba97af30e7ce6197f7eb08a16
8 changes: 4 additions & 4 deletions packages/opentelemetry-tracing/test/BasicTracer.test.ts
Original file line number Diff line number Diff line change
@@ -306,10 +306,10 @@ describe('BasicTracer', () => {
});

describe('.getCurrentSpan()', () => {
it('should return null with NoopScopeManager', () => {
it('should return undefined with NoopScopeManager', () => {
const tracer = new BasicTracer();
const currentSpan = tracer.getCurrentSpan();
assert.deepStrictEqual(currentSpan, null);
assert.deepStrictEqual(currentSpan, undefined);
});

it('should return current span when it exists', () => {
@@ -327,7 +327,7 @@ describe('BasicTracer', () => {
const tracer = new BasicTracer();
const span = tracer.startSpan('my-span');
tracer.withSpan(span, () => {
assert.deepStrictEqual(tracer.getCurrentSpan(), null);
assert.deepStrictEqual(tracer.getCurrentSpan(), undefined);
return done();
});
});
@@ -338,7 +338,7 @@ describe('BasicTracer', () => {
const tracer = new BasicTracer();
const span = tracer.startSpan('my-span');
const fn = () => {
assert.deepStrictEqual(tracer.getCurrentSpan(), null);
assert.deepStrictEqual(tracer.getCurrentSpan(), undefined);
return done();
};
const patchedFn = tracer.bind(fn, span);