import { isPromise } from "./isPromise"; describe("isPromise tests", () => { it("when function is Promise should return true", () => { expect( isPromise({ then: () => null, }), ).toBe(true); }); it("when function is not Promise should return false", () => { expect(isPromise(null)).toBe(false); expect(isPromise({})).toBe(false); expect(isPromise({ then: "AnotherType" })).toBe(false); }); });