mc-publish/tests/unit/utils/errors/error.spec.ts
2023-05-16 20:29:32 +03:00

11 lines
357 B
TypeScript

import { isError } from "@/utils/errors/error";
describe("isError", () => {
test("returns true if the input is an instance of Error", () => {
expect(isError(new Error("test error"))).toBe(true);
});
test("returns false if the input is not an instance of Error", () => {
expect(isError("not an error")).toBe(false);
});
});