invariant.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * Package-owned invariant companion for `@deepseek-ai/dsh-client-test-runtime`.
  3. * @module @deepseek-ai/dsh-client-test-runtime/invariant
  4. */
  5. /* jscpd:ignore-start */
  6. import type { Context } from '@deepseek-ai/cordis'
  7. import type { InvariantInstaller } from '@deepseek-ai/dsh-invariants'
  8. const PACKAGE_NAME = '@deepseek-ai/dsh-client-test-runtime'
  9. /** Cordis companion plugin name. */
  10. export const name = 'client-test-runtime-invariant'
  11. /** Service required before the companion can reserve package ownership. */
  12. export const inject = ['invariants']
  13. /**
  14. * No runtime invariant: this test-support package owns no production event
  15. * stream or mutable data — it assembles the runtime SlotRegistry and renderer
  16. * (whose packages own their invariants) around test doubles; its own behavior
  17. * is exercised by its package tests.
  18. */
  19. const install: InvariantInstaller = () => {}
  20. /**
  21. * Register this package's invariant companion.
  22. * @param ctx - Cordis context carrying the invariant service.
  23. * @returns the installed registration's disposer after setup succeeds.
  24. */
  25. export const apply = (ctx: Context): Promise<() => void> =>
  26. Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install))
  27. /* jscpd:ignore-end */