UNPKG

@compute.ts/math

Version:

Provide math operators for the computeTS package

1 lines 1.15 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var array_1=require("@compute.ts/array"),number_1=require("@compute.ts/number"),chai_1=require("chai");require("mocha");var ComputeMathLibrary_1=require("../ComputeMathLibrary");describe("The the min operator",function(){it("Should be able to perform an evaluation of the min operator",function(){var e=ComputeMathLibrary_1.min([12,2,3]);chai_1.expect(e.eval()).to.equal(2)}),it("Should be able to perform an evaluation of the min operator (expression array)",function(){var e=number_1.number(12),r=number_1.number(2),a=number_1.number(3),a=ComputeMathLibrary_1.min([e,r,a]);chai_1.expect(a.eval()).to.equal(2)}),it("Should be able to perform an evaluation of the min operator (array of values)",function(){var e=array_1.array.ofNumber([12,2,3]),e=ComputeMathLibrary_1.min(e);chai_1.expect(e.eval()).to.equal(2)}),it("Should be able to perform an evaluation of the min operator (array of expressions)",function(){var e=number_1.number(12),r=number_1.number(2),a=number_1.number(3),a=array_1.array.ofNumber([e,r,a]),a=ComputeMathLibrary_1.min(a);chai_1.expect(a.eval()).to.equal(2)})});