Skip to content

test: fix resume test assertions for compaction replay records#681

Merged
kermanx merged 1 commit into
mainfrom
fix/resume-compaction-test-assertions
Jun 12, 2026
Merged

test: fix resume test assertions for compaction replay records#681
kermanx merged 1 commit into
mainfrom
fix/resume-compaction-test-assertions

Conversation

@kermanx

@kermanx kermanx commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Problem

test/agent/resume.test.ts 中两个与 compaction 相关的断言(projects restored compactions into replay recordsprojects restored cancelled compactions into replay records)使用了 toEqual 严格匹配字面量对象,但 ReplayBuilder.push 会给所有 replay record 自动注入 time 字段(由 AgentReplayRecord 类型定义),导致断言失败。

What changed

将这两个 compaction 的期望对象改用 expect.objectContaining 包裹,与同一文件中 message 类型的断言方式保持一致,忽略由 ReplayBuilder 自动注入的 time 字段。

@changeset-bot

changeset-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7009a8f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 12, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@7009a8f
npx https://pkg.pr.new/@moonshot-ai/kimi-code@7009a8f

commit: 7009a8f

@kermanx kermanx force-pushed the fix/resume-compaction-test-assertions branch from 82c526f to 7009a8f Compare June 12, 2026 03:28
@kermanx kermanx merged commit 2f7218c into main Jun 12, 2026
8 checks passed
@kermanx kermanx deleted the fix/resume-compaction-test-assertions branch June 12, 2026 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant