diff --git a/packages/auth/src/di/bind-production.types.test.ts b/packages/auth/src/di/bind-production.types.test.ts new file mode 100644 index 0000000..7782a3a --- /dev/null +++ b/packages/auth/src/di/bind-production.types.test.ts @@ -0,0 +1,28 @@ +import { describe, it } from "vitest"; +import type { ProductionUseCase } from "@repo/core-shared/conformance"; +import type { AuthManifest } from "../feature.manifest"; +import type { + SignInInput, + SignInOutput, +} from "../application/use-cases/sign-in.use-case"; +import { signInUseCase } from "../application/use-cases/sign-in.use-case"; + +describe("auth.signIn binding slot (type-level)", () => { + it("rejects an unwrapped factory", () => { + type Slot = ProductionUseCase< + SignInInput, + SignInOutput, + AuthManifest["useCases"]["signIn"] + >; + + // Build the unwrapped factory exactly as it would be at the use-case file. + // It returns a function with no brand attached — must not be assignable. + const fakeRepo = {} as never; + const fakeAuth = {} as never; + const unwrapped = signInUseCase(fakeRepo, fakeAuth); + + // @ts-expect-error — unwrapped factory has no __instrumented / __captured brand + const _bad: Slot = unwrapped; + void _bad; + }); +});