Files
deepseek-harness/packages/experimental/liveshare-protocol/tests/entrypoints.spec.ts
T
mektpoy 535c40d4b7 test(liveshare-protocol): gate the package at per-file coverage
The protocol package leaves the repository-wide coverage exemption and meets the same per-file 100%
gate as the other packages. The new specs cover the identity mock, the wire helpers and every
additive-field parser branch, both public entry points, and the carrier's forwarded-route paths; the
key parser drops an unreachable guard so its remaining branches are exercised.
2026-10-23 16:13:23 +08:00

22 lines
1.2 KiB
TypeScript

/** The package's public entry points re-export the one shared contract. */
import { expect, it } from 'vitest'
import * as identity from '@deepseek-ai/dsh-experimental-liveshare-protocol/identity'
import * as protocol from '@deepseek-ai/dsh-experimental-liveshare-protocol/protocol'
import * as root from '@deepseek-ai/dsh-experimental-liveshare-protocol'
it('re-exports the protocol and identity contracts from the package root', () => {
expect(root.LIVESHARE_PROTOCOL_VERSION).toBe(protocol.LIVESHARE_PROTOCOL_VERSION)
expect(root.parseShareAccessState).toBe(protocol.parseShareAccessState)
expect(root.identityKeyOf).toBe(identity.identityKeyOf)
expect(root.MockIdentityProvider).toBe(identity.MockIdentityProvider)
expect(root.viewerCarrierScript).toBeTypeOf('function')
})
it('re-exports the identity contract from its own entry', () => {
expect(identity.identityKeyOf({ providerId: 'p', tenantId: 't', subjectId: 's' })).toBe('p:t:s')
expect(identity.identityFromKey('p:t:s')).toEqual({ providerId: 'p', tenantId: 't', subjectId: 's' })
expect(identity.identityFromKey('p:t')).toBeUndefined()
expect(identity.identityFromKey('p::s')).toBeUndefined()
})