跳到正文
Skillpedia
测试75k · #2895

integration-testing

它能做什么

这项技能审查你的关键工作流,并添加测试,覆盖服务、数据库和组件之间的交互。适用于希望发布可靠版本的开发者。

适用场景

  • ✓当某个功能通过了单元测试,但在各部分连接后失败的时候。
  • ✓当你的 API 路由调用服务和数据库,而中间没有任何测试的时候。
  • ✓当你希望对最重要的用户工作流进行自动化检查的时候。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/integration-testing/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/integration-testing/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请为我应用中的结账流程编写集成测试。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会找出系统各部分相互衔接的地方,并为这些连接编写测试。它建议使用真实的测试数据库,而不是把所有东西都模拟掉。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Write integration tests for key workflows

Unit tests verify individual functions in isolation, but they can't catch the bugs that occur when those functions interact — a perfectly correct validation function and a correct database function can still fail when wired together incorrectly. Integration tests catch these wiring bugs before they reach production, where they're expensive to diagnose.

Quick Reference

  • Integration tests verify that multiple units work correctly together
  • Test at the boundary where different parts of your system meet
  • Use a real database in tests (test DB or in-memory) rather than mocking everything
  • Test happy paths and the most critical error paths

Check

Identify the key integration points in this codebase — where API routes call services, where services interact with the database, and where components interact with state management. Are these tested?

Fix

Write integration tests for the identified critical paths, testing the interactions between components rather than each in isolation.

Explain

Explain integration testing, how it differs from unit and E2E testing, and what tools to use for API and component integration tests.

Code Review

Review tests, CI workflows, and enforcement points related to Write integration tests for key workflows. Flag exact gaps where the rule is not automatically verified or where failures do not block regressions.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/testing/integration-testing

常见问题

这与端到端测试有什么不同?

这项技能将集成测试描述为检查多个单元协同工作,而端到端测试涵盖整个用户流程。

数据库应该被模拟吗?

这项技能建议在可能的情况下使用真实的测试数据库或内存数据库。

应该测试哪些路径?

这项技能建议测试正常路径以及最关键的错误路径。

详情

作者的原始描述

Use when reviewing CI coverage, automated checks, or test strategy related to Write integration tests for key workflows. Focus on whether the rule is continuously verified, not just documented.

repo: thedaviddias/Front-End-Checklist

热度

GitHub 星标
75k
排名
#2895
许可证
MIT
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能