@emartech/aggregate-metric-logger 3.3.1 → 3.3.2
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
|
@@ -4,12 +4,12 @@ const { createCounter } = require('./counter');
|
|
|
4
4
|
|
|
5
5
|
describe('count', () => {
|
|
6
6
|
it('should return an empty counter if no values were added', () => {
|
|
7
|
-
jest.useFakeTimers().setSystemTime(new Date(
|
|
7
|
+
jest.useFakeTimers().setSystemTime(new Date(8880));
|
|
8
8
|
const counter = createCounter();
|
|
9
9
|
|
|
10
10
|
expect(counter.getState()).toEqual({
|
|
11
|
-
startTime:
|
|
12
|
-
endTime:
|
|
11
|
+
startTime: 7880,
|
|
12
|
+
endTime: 8880,
|
|
13
13
|
metricKind: 'CUMULATIVE',
|
|
14
14
|
valueType: 'int64Value',
|
|
15
15
|
value: { int64Value: '0' }
|
|
@@ -18,7 +18,7 @@ describe('count', () => {
|
|
|
18
18
|
|
|
19
19
|
it('should return with the startTime which is before the endTime even when no time passes', () => {
|
|
20
20
|
// which is a must-have for non-gauge metrics
|
|
21
|
-
jest.useFakeTimers().setSystemTime(new Date(
|
|
21
|
+
jest.useFakeTimers().setSystemTime(new Date(8880));
|
|
22
22
|
const counter = createCounter();
|
|
23
23
|
expect(counter.getState().endTime).toBeGreaterThan(counter.getState().startTime);
|
|
24
24
|
});
|
|
@@ -33,7 +33,7 @@ describe('count', () => {
|
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
it('should not reset the current count on advanceTimer call', () => {
|
|
36
|
-
jest.useFakeTimers().setSystemTime(new Date(
|
|
36
|
+
jest.useFakeTimers().setSystemTime(new Date(8880));
|
|
37
37
|
const counter = createCounter();
|
|
38
38
|
|
|
39
39
|
jest.advanceTimersByTime(20);
|
|
@@ -43,8 +43,8 @@ describe('count', () => {
|
|
|
43
43
|
|
|
44
44
|
expect(counter.getState()).toMatchObject({
|
|
45
45
|
value: { int64Value: '3' },
|
|
46
|
-
startTime:
|
|
47
|
-
endTime:
|
|
46
|
+
startTime: 7880,
|
|
47
|
+
endTime: 8900
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
50
|
|