Skip to content

Match the ask test fixture to the real response shape - #2

Merged
fatwang2 merged 1 commit into
mainfrom
test/ask-intent-fixture
Oct 10, 2026
Merged

fatwang2 merged 1 commit into
mainfrom
test/ask-intent-fixture

Conversation

@fatwang2

Copy link
Copy Markdown
Member

改动

  • test/tools.test.ts 里 ask 的 mock 响应改成和真实返回一致:intent.keywords 改为 intent.search_query,并补上顶层的 query
  • mock 标注为 AskResponse 类型,以后字段名写错 typecheck 会直接报错(已确认:写回 keywords 时 tsc 报 TS2353)

只改测试,不影响发布的包,不需要发版。

验证

  • typecheck 通过,20 个测试通过
  • 字段名对照了 2026-10-11 一次真实 /ask 调用的返回

The fixture used intent.keywords; the API returns intent.search_query and a top-level query. Typing it as AskResponse lets typecheck catch this drift.
@fatwang2
fatwang2 merged commit a5f6133 into main Oct 10, 2026
6 checks passed
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