# Changelog

## [0.1.0] - 2026-05-18

首发版本 — 与 `cmdc` 主库 0.5.0 协同发布。

### Added

- **`CMDCTest.MockProvider`** — Builder API（`new/0` + `respond/2` + `respond_tool_call/3` + `respond_error/2`），导出 `to_provider_fn/1` 闭包给 `CMDC.Config.provider_fn`
- **`CMDCTest.Plugin`** — `run_hook/3` 单元测 plugin + `default_ctx/1` Context 工厂
- **`CMDCTest.Plugin.Spy`** — 通过 anonymous handler 注入到 Agent Plugin Pipeline，无需 `:meck` 依赖
- **`CMDCTest.EventCapture`** — `start_capture/1` + `stop_capture/1` EventBus 订阅 helper
- **`CMDCTest.Assertions`** — `assert_event_emitted/3` + `refute_event_emitted/3` + `assert_event_count/4` 事件断言族,
  内部 receive loop 不匹配事件**自动 requeue 回 mailbox**，不污染后续断言
- 26 个单测 + 集成测全覆盖

### v0.1 范围说明（明确不含）

- ❌ fixtures 库（v0.2）
- ❌ `with_mock_plugin` macro（推荐 `Spy` plugin 替代）
- ❌ Property-based testing 集成（用户自行配 stream_data）
- ❌ Tool 测试 helper（跟随 cmdc 主库 Tool behaviour 演进再加，v0.2+）

### Migration

新引入，无 migration。
