pragmatic-fp-ts
Version:
Opinionated functional programming library with easy use in mind
15 lines (12 loc) • 326 B
text/typescript
import { mod } from "../main.ts";
describe("mod()", () => {
it("calculates the module", () => {
expect(mod(4, 1)).toBe(1);
expect(mod(2)(81191)).toBe(1);
});
it("calculates the negative module", () => {
expect(mod(2)(-1)).toBe(1);
expect(mod(2)(-2)).toBe(0);
expect(mod(4)(-37)).toBe(3);
});
});