Skip to content

Commit

Permalink
add removed test
Browse files Browse the repository at this point in the history
  • Loading branch information
Abinet18 committed Mar 13, 2024
1 parent b9bf4ea commit 441a301
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/opentelemetry-sdk-trace-web/test/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,27 @@ describe('utils', () => {
assert.strictEqual(addEventSpy.callCount, 0);
});
});
describe('when entries does NOT contain the performance', () => {
it('should NOT add event to span', () => {
const addEventSpy = sinon.spy();
const span = {
addEvent: addEventSpy,
} as unknown as tracing.Span;
const entries = {
[PTN.FETCH_START]: 123,
} as PerformanceEntries;

assert.strictEqual(addEventSpy.callCount, 0);

addSpanNetworkEvent(span, 'foo', entries);

assert.strictEqual(
addEventSpy.callCount,
0,
'should not call addEvent'
);
});
});
describe('when entries contain invalid performance timing', () => {
it('should only add events with time greater that or equal to reference value to span', () => {
const addEventSpy = sinon.spy();
Expand Down

0 comments on commit 441a301

Please sign in to comment.