source: trip-planner-front/node_modules/hdr-histogram-js/dist/log.spec.js@ fa375fe

Last change on this file since fa375fe was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 958 bytes
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const _1 = require(".");
4describe("Logs", () => {
5 it("should give same result after been written then read", () => {
6 // given
7 let buffer = "";
8 const writer = new _1.HistogramLogWriter((content) => {
9 buffer += content;
10 });
11 writer.outputLogFormatVersion();
12 writer.outputStartTime(12345000);
13 writer.outputLegend();
14 const inputHistogram = _1.build();
15 inputHistogram.recordValue(42);
16 // when
17 writer.outputIntervalHistogram(inputHistogram, 12345042, 1234056, 1);
18 const reader = new _1.HistogramLogReader(buffer);
19 const outputHistogram = reader.nextIntervalHistogram();
20 // then
21 expect(outputHistogram).not.toBeNull();
22 // @ts-ignore
23 expect(outputHistogram.mean).toBe(inputHistogram.mean);
24 });
25});
26//# sourceMappingURL=log.spec.js.map
Note: See TracBrowser for help on using the repository browser.