updeep-remeda/dist/constant.test.js

13 lines
444 B
JavaScript
Raw Normal View History

2023-01-03 18:51:35 +00:00
import { expect, test } from "vitest";
import constant from "./constant.js";
test("returns what it is given... constantly", () => {
const func = constant(4);
expect(func()).to.equal(4);
expect(func("hi")).to.equal(4);
expect(func("hi", 8)).to.equal(4);
expect(func(4)).to.equal(4);
});
test("freezes the result", () => {
expect(Object.isFrozen(constant({})())).toBeTruthy();
});
//# sourceMappingURL=constant.test.js.map