import { describe, it } from "vitest"; import { Expect, Test, } from "inferred-types/types"; import { AssertEqual, AssertExtends, EmptyObject } from "inferred-types"; import { KindError, KindErrorSignature } from "~/types"; describe("KindErrorSignature", () => { it("no schema", () => { // when no schema is defined then a looser approach is taken // with the context object type T1 = KindErrorSignature<"Testing", Record>; type Params = Parameters; type Rtn = ReturnType; type cases = [ Expect ] >> ]; }); it("no variant key/values", () => { type T1 = KindErrorSignature<"Testing", {test: true}>; type P = Parameters; type Rtn = ReturnType; type cases = [ Expect>, Expect, ]; }); it("test", () => { type T = KindErrorSignature<"testing", { test: true, foo: "string | undefined" }>; type P = Parameters; type Rtn = ReturnType; type cases = [ Expect>, Expect>, Expect>>, Expect>>, Expect>>, ]; }); it("no required but with optional context", () => { type T = KindErrorSignature<"testing", {test: true, answer: `42 | undefined`}> type P = Parameters; type Rtn = ReturnType; type cases = [ Expect>, Expect>, ]; }); it("required prop", () => { type T1 = KindErrorSignature<"testing", {test: true, answer: 42 | 99}> type P = Parameters; type Rtn = ReturnType; type cases = [ Expect>, Expect>, ]; }); });