Skip to content

Commit f0737fa

Browse files
committed
Add test
1 parent d1ea9e9 commit f0737fa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/core/test/lib/metrics/internal.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,10 @@ describe('_INTERNAL_captureMetric', () => {
256256
// Add one more to trigger flush
257257
_INTERNAL_captureMetric({ type: 'counter', name: 'trigger.flush', value: 999 }, { scope });
258258

259-
expect(_INTERNAL_getMetricBuffer(client)).toEqual([]);
259+
// After flushing the 1000 metrics, the new metric starts a fresh buffer with 1 item
260+
const buffer = _INTERNAL_getMetricBuffer(client);
261+
expect(buffer).toHaveLength(1);
262+
expect(buffer?.[0]?.name).toBe('trigger.flush');
260263
});
261264

262265
it('does not flush metrics buffer when it is empty', () => {

0 commit comments

Comments
 (0)