From 97f4d4608baf97949dbc0ba07db23289bb26fedb Mon Sep 17 00:00:00 2001 From: imccyu <276526105+imccyu@users.noreply.github.com> Date: Wed, 19 Aug 2026 13:44:23 +0800 Subject: [PATCH] test(gateway): pin the namespace atomic-visibility guarantee --- packages/api/gateway/tests/gateway.client.spec.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/api/gateway/tests/gateway.client.spec.ts b/packages/api/gateway/tests/gateway.client.spec.ts index c6d4a03eb3..99fe477bf2 100644 --- a/packages/api/gateway/tests/gateway.client.spec.ts +++ b/packages/api/gateway/tests/gateway.client.spec.ts @@ -528,6 +528,21 @@ describe('Client Typert API', () => { expect(ctx.get('remote.probe')).toBeUndefined() }) + it('unparks a namespace dependent only after its contribution methods exist', async () => { + const ctx = await bench(vi.fn()) + const { scope: _scope, ...direct } = directDescriptor() + let observed: string | undefined + // Parked before the mount: the unpark moment is the observation — the + // atomic-visibility guarantee says the service never appears methodless. + const parked = ctx.inject(['remote.probe'], (probeCtx) => { + observed = typeof (probeCtx.get('remote.probe') as { create?: unknown } | undefined)?.create + }) + const dispose = await ctx.remote.$mount({ package: '@fixture/atomic-visibility', descriptors: [direct] }) + await parked + expect(observed).toBe('function') + await dispose() + }) + it('rejects weak parameter and Context codecs plus malformed scope projections', async () => { const ctx = await bench(vi.fn()) const direct = directDescriptor()