test(features): exercise bind-production conformance assertion in CI
Each feature's bind-production.ts already ends with assertFeatureConformance(), but that check only fired on `pnpm dev`. Adds a smoke test per feature that invokes the binder with a Noop ctx, so missing __instrumented / __captured / __audited brands now fail under `pnpm test` (and therefore in CI), closing the gap between the TypeScript brand layer and the boot-time runtime assertion.
This commit is contained in:
17
packages/auth/src/di/bind-production.smoke.test.ts
Normal file
17
packages/auth/src/di/bind-production.smoke.test.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import "reflect-metadata";
|
||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
import type { SanitizedConfig } from "payload";
|
||||||
|
import { NoopTracer, NoopLogger } from "@repo/core-shared/instrumentation";
|
||||||
|
import { bindProductionAuth } from "@/di/bind-production";
|
||||||
|
|
||||||
|
describe("bindProductionAuth — boot-time conformance", () => {
|
||||||
|
it("binds every manifest use case through withSpan + withCapture", () => {
|
||||||
|
expect(() =>
|
||||||
|
bindProductionAuth({
|
||||||
|
config: {} as SanitizedConfig,
|
||||||
|
tracer: new NoopTracer(),
|
||||||
|
logger: new NoopLogger(),
|
||||||
|
}),
|
||||||
|
).not.toThrow();
|
||||||
|
});
|
||||||
|
});
|
||||||
17
packages/blog/src/di/bind-production.smoke.test.ts
Normal file
17
packages/blog/src/di/bind-production.smoke.test.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import "reflect-metadata";
|
||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
import type { SanitizedConfig } from "payload";
|
||||||
|
import { NoopTracer, NoopLogger } from "@repo/core-shared/instrumentation";
|
||||||
|
import { bindProductionBlog } from "@/di/bind-production";
|
||||||
|
|
||||||
|
describe("bindProductionBlog — boot-time conformance", () => {
|
||||||
|
it("binds every manifest use case through withSpan + withCapture", () => {
|
||||||
|
expect(() =>
|
||||||
|
bindProductionBlog({
|
||||||
|
config: {} as SanitizedConfig,
|
||||||
|
tracer: new NoopTracer(),
|
||||||
|
logger: new NoopLogger(),
|
||||||
|
}),
|
||||||
|
).not.toThrow();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import "reflect-metadata";
|
||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
import type { SanitizedConfig } from "payload";
|
||||||
|
import { NoopTracer, NoopLogger } from "@repo/core-shared/instrumentation";
|
||||||
|
import { bindProductionMarketingPages } from "@/di/bind-production";
|
||||||
|
|
||||||
|
describe("bindProductionMarketingPages — boot-time conformance", () => {
|
||||||
|
it("binds every manifest use case through withSpan + withCapture", () => {
|
||||||
|
expect(() =>
|
||||||
|
bindProductionMarketingPages({
|
||||||
|
config: {} as SanitizedConfig,
|
||||||
|
tracer: new NoopTracer(),
|
||||||
|
logger: new NoopLogger(),
|
||||||
|
}),
|
||||||
|
).not.toThrow();
|
||||||
|
});
|
||||||
|
});
|
||||||
17
packages/media/src/di/bind-production.smoke.test.ts
Normal file
17
packages/media/src/di/bind-production.smoke.test.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import "reflect-metadata";
|
||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
import type { SanitizedConfig } from "payload";
|
||||||
|
import { NoopTracer, NoopLogger } from "@repo/core-shared/instrumentation";
|
||||||
|
import { bindProductionMedia } from "@/di/bind-production";
|
||||||
|
|
||||||
|
describe("bindProductionMedia — boot-time conformance", () => {
|
||||||
|
it("binds every manifest use case through withSpan + withCapture", () => {
|
||||||
|
expect(() =>
|
||||||
|
bindProductionMedia({
|
||||||
|
config: {} as SanitizedConfig,
|
||||||
|
tracer: new NoopTracer(),
|
||||||
|
logger: new NoopLogger(),
|
||||||
|
}),
|
||||||
|
).not.toThrow();
|
||||||
|
});
|
||||||
|
});
|
||||||
17
packages/navigation/src/di/bind-production.smoke.test.ts
Normal file
17
packages/navigation/src/di/bind-production.smoke.test.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import "reflect-metadata";
|
||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
import type { SanitizedConfig } from "payload";
|
||||||
|
import { NoopTracer, NoopLogger } from "@repo/core-shared/instrumentation";
|
||||||
|
import { bindProductionNavigation } from "@/di/bind-production";
|
||||||
|
|
||||||
|
describe("bindProductionNavigation — boot-time conformance", () => {
|
||||||
|
it("binds every manifest use case through withSpan + withCapture", () => {
|
||||||
|
expect(() =>
|
||||||
|
bindProductionNavigation({
|
||||||
|
config: {} as SanitizedConfig,
|
||||||
|
tracer: new NoopTracer(),
|
||||||
|
logger: new NoopLogger(),
|
||||||
|
}),
|
||||||
|
).not.toThrow();
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user