2022-07-07 05:23:54 +00:00
|
|
|
import { describe, expect, it } from "vitest";
|
2022-07-05 11:01:23 +00:00
|
|
|
import { isDefined } from "./isDefined";
|
|
|
|
|
|
|
|
describe("isDefined", () => {
|
|
|
|
it("detects defined values", () => {
|
|
|
|
expect(isDefined(0)).toBe(true);
|
|
|
|
expect(isDefined(false)).toBe(true);
|
|
|
|
expect(isDefined("")).toBe(true);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("detects undefined values", () => {
|
|
|
|
expect(isDefined(undefined)).toBe(false);
|
|
|
|
expect(isDefined(null)).toBe(false);
|
|
|
|
});
|
|
|
|
});
|