import { describe, it } from "vitest"; import { AssertEqual, Dictionary, Expect, EmptyObject } from "inferred-types/types"; import { ParseContext } from "~/index"; describe("ParseContext", () => { it("empty object", () => { type T = ParseContext; type cases = [ Expect> ]; }); it("wide dictionary", () => { type T = ParseContext>; type cases = [ Expect>> ]; }); it("keys are literals", () => { type T = ParseContext<{foo: "foo"; bar: "bar"}>; type cases = [ Expect> ]; }); it("some literals mixed with undefined union", () => { type T = ParseContext<{foo: "foo"; bar: "bar" | undefined}>; type cases = [ Expect> ]; }); it("token only", () => { type T = ParseContext<{foo: "string | undefined"; bar: "number"}>; type cases = [ Expect> ]; }); it("mixed tokens and literals", () => { type T = ParseContext<{foo: "string | undefined"; bar: "hello"}>; type cases = [ Expect> ]; }); it("immutable mixed tokens and literals", () => { type T = ParseContext<{readonly foo: "string | undefined"; readonly bar: "hello"}>; type cases = [ Expect> ]; }); });