import { expect, test } from "tstyche"; type Worker = { [K in keyof T as Exclude]: T[K]; }; interface Sample { [key: `data-${string}`]: string; isBusy?: boolean | undefined; runTest: (a: string, b: number) => void; setup: () => void; teardown: () => void; } test("Worker", () => { expect>().type.toHaveProperty("data-sample"); expect>().type.toHaveProperty("isBusy"); expect>().type.toHaveProperty("runTest"); expect>().type.not.toHaveProperty("setup"); expect>().type.not.toHaveProperty("teardown"); });