diff --git a/scripts/package-invariants.spec.ts b/scripts/package-invariants.spec.ts index bea8afb991..9995d078bf 100644 --- a/scripts/package-invariants.spec.ts +++ b/scripts/package-invariants.spec.ts @@ -187,4 +187,17 @@ export const apply = (ctx: { invariants: { register(name: string, install: typeo expect(collectPackageInvariantViolations(root).map(violation => violation.message)) .toContain('name-based plugin invariant "shared-runtime-name" is already owned by "@deepseek-ai/dsh-probe-two"') }) + + it('rejects an unexplained empty package installer', () => { + const source = ` +export const name = 'probe-invariant' +export const inject = ['invariants'] +const PACKAGE_NAME = '@deepseek-ai/dsh-probe' +const install = () => {} +export const apply = (ctx: { invariants: { register(name: string, install: () => void): () => void } }) => + ctx.invariants.register(PACKAGE_NAME, install) +` + expect(collectPackageInvariantViolations(fixture({ source })).map(violation => violation.message)) + .toContain('empty install function must explain why with a "No runtime invariant:" comment') + }) })