import { Late } from "silentium"; import { expect, test, vi } from "vitest"; import { And } from "../boolean/And"; test("And.test", () => { const $one = Late(false); const $two = Late(false); const result = And($one, $two); const g = vi.fn(); result.then(g); expect(g).toHaveBeenLastCalledWith(false); $one.use(true); $two.use(false); expect(g).toHaveBeenLastCalledWith(false); $one.use(false); $two.use(true); expect(g).toHaveBeenLastCalledWith(false); $one.use(true); $two.use(true); expect(g).toHaveBeenLastCalledWith(true); });