Added a test for the new bin utilities module.

This commit is contained in:
Harrison Deng 2022-04-23 01:16:56 -05:00
parent aa8c43044a
commit 1277968f31

14
tests/testBins.js Normal file
View File

@ -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);
});
});
});