# @deepseek-ai/dsh-client-test-runtime
[English](README.md) | 中文
面向客户端功能测试的 jsdom slot 测试运行时:真实 Cordis `Context`、renderer 所有的 `SlotRegistry` 与生产 `UiSession` adapter,围绕带类型的 Session 和 Workspace Controller 测试替身组装。功能套件无需复制生产 renderer 或 adapter 逻辑,即可测试声明、注册、scope、store、注入、渲染、更新与销毁。
替身实现通过 Cordis 消费的 owner 接口:`TestSessions implements ISessions`、`TestWorkspaces implements IWorkspaces`,每个 fixture Session 是 `FixtureSession implements SessionFace`,`stubSettingsScope` 实现 `SettingsScope`。运行时挂载 `UiSession`,由它从 Controller binding 派生 renderer 标准 source。fixture 通过 `updateSessionSnapshot` 发布 Session 生命周期状态,通过 `TestWorkspaces.update` 发布 Workspace 状态,通过 Session face 发布 projection 值,并通过 Session event feed 提供 Conversation 输入。未打桩的 `ISession` 行为会在错误中指出缺失方法。
局部 DOM 快照:`declare(children)` 注册自动 frame,逐 key 的 `
` 包裹层即快照根;`renderSlot(key, owner)` 返回该 slot 的局部视图(container、限定范围的 Testing Library 查询、原位 `update(owner)`);注册的快照序列化器把 CSS-module 哈希类名折回语义名(`_frame_a1b2c3` → `frame`)保持 `.snap` 只含结构,并把 `