From 1277968f31559d1a85d2de68ffcfb5d28da8caf9 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Sat, 23 Apr 2022 01:16:56 -0500 Subject: [PATCH] Added a test for the new bin utilities module. --- tests/testBins.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/testBins.js diff --git a/tests/testBins.js b/tests/testBins.js new file mode 100644 index 0000000..d0c8bb3 --- /dev/null +++ b/tests/testBins.js @@ -0,0 +1,14 @@ +/* eslint-disable no-undef */ +import { expect } from "chai"; +import { describe } from "mocha"; +import { createUniAvgSel } from "../src/support/bins.js"; + +describe("Bin utilities", function () { + describe("the function that generates a uniform average of the array values", function () { + it("returns 2 given [1, 2, 3]", function () { + const unifAvgFunc = createUniAvgSel(); + const avg = unifAvgFunc([1, 2, 3]); + expect(avg).to.equal(2); + }); + }); +}); \ No newline at end of file