source: trip-planner-front/node_modules/hdr-histogram-js/dist/index.spec.js@ ceaed42

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

initial commit

  • Property mode set to 100644
File size: 1.2 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3/*
4 * This is a TypeScript port of the original Java version, which was written by
5 * Gil Tene as described in
6 * https://github.com/HdrHistogram/HdrHistogram
7 * and released to the public domain, as explained at
8 * http://creativecommons.org/publicdomain/zero/1.0/
9 */
10const hdr = require("./index");
11describe("Histogram builder", () => {
12 it("should build histogram with default values", () => {
13 // given
14 // when
15 const histogram = hdr.build();
16 // then
17 expect(histogram).not.toBeNull();
18 expect(histogram.autoResize).toBe(true);
19 expect(histogram.highestTrackableValue).toBe(2);
20 });
21 it("should build histogram with custom parameters", () => {
22 // given
23 // when
24 const histogram = hdr.build({
25 bitBucketSize: 32,
26 numberOfSignificantValueDigits: 2,
27 });
28 const expectedHistogram = new hdr.Int32Histogram(1, 2, 2);
29 expectedHistogram.autoResize = true;
30 histogram.recordValue(12345);
31 expectedHistogram.recordValue(12345);
32 // then
33 expect(histogram.mean).toBe(expectedHistogram.mean);
34 });
35});
36//# sourceMappingURL=index.spec.js.map
Note: See TracBrowser for help on using the repository browser.