Skip to content

e2e test 不要搞 api.github.com#1489

Merged
CodFrm merged 3 commits into
mainfrom
fix/e2e-test/002
Jun 5, 2026
Merged

e2e test 不要搞 api.github.com#1489
CodFrm merged 3 commits into
mainfrom
fix/e2e-test/002

Conversation

@cyfung1031
Copy link
Copy Markdown
Collaborator

@cyfung1031 cyfung1031 commented Jun 5, 2026

api.github.com 不是用来给 bot 搞测试的

Screenshot 2026-06-05 at 9 05 05

@cyfung1031 cyfung1031 marked this pull request as ready for review June 5, 2026 00:07
@CodFrm
Copy link
Copy Markdown
Member

CodFrm commented Jun 5, 2026

补充内容已按 PR 分支处理并推送到 fix/e2e-test/002

本次补充 commit: fce9ccc

调整内容:

  • e2e/gm-api.spec.ts 里为 GM sync/async API 测试增加本地 mock server。
  • e2e 安装脚本时把 @connect httpbun.com patch 到 127.0.0.1,并把 https://httpbun.com/get patch 到本地 /get,避免 Playwright 真实访问外网。
  • mock 响应返回实际请求 URL,保证 example 脚本中的 data.url 断言在真实 httpbun 和 e2e mock 下都成立。

验证结果(在独立 worktree scriptcat-pr-1489 上):

  • pnpm run lint:0 errors,12 个既有 warnings
  • pnpm exec playwright test e2e/gm-api.spec.ts:5/5 passed
  • pnpm test:51 files / 954 tests passed
  • pnpm run test:e2e:27/27 passed
  • git diff --check:passed
  • api.github.com / GITHUB_REPO_API_URLe2e example src packages tests 范围内无命中

@CodFrm CodFrm merged commit e241636 into main Jun 5, 2026
4 checks passed
@CodFrm CodFrm deleted the fix/e2e-test/002 branch June 5, 2026 06:30
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.

2 participants