keycloak-scim/apps/admin-ui/src/utils/isDefined.test.ts

16 lines
419 B
TypeScript
Raw Normal View History

2022-07-07 05:23:54 +00:00
import { describe, expect, it } from "vitest";
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);
});
});