Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanista committed Feb 7, 2024
1 parent ca3c836 commit bf0b1ae
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions src/trace/span-context-wrapper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,31 @@ describe("SpanContextWrapper", () => {

describe("sampleMode", () => {
it("should return AUTO_KEEP when sampling priority is not available in spanContext", () => {
const spanContext = new SpanContextWrapper({
toSpanId: () => "1234",
toTraceId: () => "5678",
_sampling: {}
}, TraceSource.Event);

const sampleMode = spanContext.sampleMode()
const spanContext = new SpanContextWrapper(
{
toSpanId: () => "1234",
toTraceId: () => "5678",
_sampling: {},
},
TraceSource.Event,
);

const sampleMode = spanContext.sampleMode();
expect(sampleMode).toBe(SampleMode.AUTO_KEEP);
expect(sampleMode.toString()).toBe("1");
})
});

it("should return sampling priority when available in spanContext", () => {
const spanContext = new SpanContextWrapper({
toSpanId: () => "1234",
toTraceId: () => "5678",
_sampling: { priority: 2 }
}, TraceSource.Event);

const sampleMode = spanContext.sampleMode()
const spanContext = new SpanContextWrapper(
{
toSpanId: () => "1234",
toTraceId: () => "5678",
_sampling: { priority: 2 },
},
TraceSource.Event,
);

const sampleMode = spanContext.sampleMode();
expect(sampleMode).toBe(2);
expect(sampleMode.toString()).toBe("2");
});
Expand Down

0 comments on commit bf0b1ae

Please sign in to comment.