@emartech/aggregate-metric-logger 6.7.2 → 6.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -551,10 +551,31 @@ describe('gcpMetricCollector', () => {
|
|
|
551
551
|
gcpMetricCollector.count('jolo', {}, 1);
|
|
552
552
|
jest.advanceTimersByTime(60 * 1000 + 1);
|
|
553
553
|
|
|
554
|
+
expect(MetricServiceClient.prototype.createTimeSeries).toHaveBeenCalledTimes(1);
|
|
555
|
+
|
|
554
556
|
firstCreateTimeSeriesPromise.resolve();
|
|
555
557
|
await flushPromises();
|
|
558
|
+
});
|
|
556
559
|
|
|
557
|
-
|
|
560
|
+
it('should publish the second count after the first flush resolves', async () => {
|
|
561
|
+
const firstCreateTimeSeriesPromise = resolvablePromise();
|
|
562
|
+
jest.spyOn(MetricServiceClient.prototype, 'createTimeSeries')
|
|
563
|
+
.mockReturnValueOnce(firstCreateTimeSeriesPromise)
|
|
564
|
+
.mockResolvedValue();
|
|
565
|
+
|
|
566
|
+
gcpMetricCollector.count('jolo', {}, 1);
|
|
567
|
+
jest.advanceTimersByTime(60 * 1000 + 1);
|
|
568
|
+
|
|
569
|
+
gcpMetricCollector.count('jolo', {}, 1);
|
|
570
|
+
jest.advanceTimersByTime(60 * 1000 + 1);
|
|
571
|
+
|
|
572
|
+
firstCreateTimeSeriesPromise.resolve();
|
|
573
|
+
await flushPromises();
|
|
574
|
+
|
|
575
|
+
jest.advanceTimersByTime(60 * 1000 + 1);
|
|
576
|
+
await flushPromises();
|
|
577
|
+
|
|
578
|
+
expect(MetricServiceClient.prototype.createTimeSeries).toHaveBeenCalledTimes(2);
|
|
558
579
|
});
|
|
559
580
|
});
|
|
560
581
|
|