重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
npx skills add https://github.com/teachingai/full-stack-skills --skill jest当用户想要进行以下操作时,请使用此技能:
此技能的组织结构与 Jest 官方文档结构(https://jestjs.io/docs/getting-started,https://jestjs.io/docs/api)相匹配。在使用 Jest 时:
* 入门/快速开始 → `examples/getting-started/installation.md` 或 `examples/getting-started/using-matchers.md`
* 测试 → `examples/testing/asynchronous.md` 或 `examples/testing/setup-teardown.md`
* Mock 函数 → `examples/testing/mock-functions.md`
* Mock 模块 → `examples/testing/manual-mocks.md`
* 快照 → `examples/testing/snapshot-testing.md`
* 配置 → `examples/configuration/jest-config.md`
* 命令行 → `examples/configuration/cli-options.md`
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
2. 从 examples/ 目录加载相应的示例文件:
入门(快速开始) - examples/getting-started/:
* `examples/getting-started/installation.md` \- 安装 Jest 和基本设置
* `examples/getting-started/using-matchers.md` \- 使用 Jest 匹配器和断言
测试 - examples/testing/:
* `examples/testing/asynchronous.md` \- 测试异步代码
* `examples/testing/setup-teardown.md` \- 设置和清理函数
* `examples/testing/mock-functions.md` \- Mock 函数
* `examples/testing/manual-mocks.md` \- 手动 Mock
* `examples/testing/snapshot-testing.md` \- 快照测试
* `examples/testing/timer-mocks.md` \- Mock 定时器
* `examples/testing/es6-class-mocks.md` \- Mock ES6 类
配置 - examples/configuration/:
* `examples/configuration/jest-config.md` \- Jest 配置选项
* `examples/configuration/cli-options.md` \- CLI 选项和标志
* `examples/configuration/babel.md` \- 将 Jest 与 Babel 一起使用
* `examples/configuration/typescript.md` \- 将 Jest 与 TypeScript 一起使用
指南 - examples/guides/:
* `examples/guides/migrating-to-jest.md` \- 迁移到 Jest
* `examples/guides/testing-react-apps.md` \- 测试 React 应用程序
* `examples/guides/testing-vue-apps.md` \- 测试 Vue 应用程序
3. 遵循该示例文件中关于语法、结构和最佳实践的具体说明
重要提示:
* 所有示例都遵循 Jest 最佳实践
* 示例在适用时包含 JavaScript 和 TypeScript 版本
* 每个示例文件都包含关键概念、代码示例和要点
* 始终检查示例文件以了解最佳实践和常见模式
4. 需要时参考 api/ 目录中的 API 文档:
* `api/expect.md` \- expect() API 和匹配器
* `api/mock-functions.md` \- Mock 函数 API
* `api/jest-object.md` \- Jest 对象 API
* `api/test.md` \- test() 和 describe() API
* `api/cli.md` \- CLI 命令和选项
5. 使用 templates/ 目录中的模板:
* `templates/jest-config.md` \- Jest 配置模板
* `templates/test-template.md` \- 测试文件模板
* `templates/setup-file.md` \- 设置文件模板
入门(快速开始):
examples/getting-started/installation.md → https://jestjs.io/docs/getting-startedexamples/getting-started/using-matchers.md → https://jestjs.io/docs/using-matchers测试:
examples/testing/asynchronous.md → https://jestjs.io/docs/asynchronousexamples/testing/setup-teardown.md → https://jestjs.io/docs/setup-teardownexamples/testing/mock-functions.md → https://jestjs.io/docs/mock-functionsexamples/testing/manual-mocks.md → https://jestjs.io/docs/manual-mocksexamples/testing/snapshot-testing.md → https://jestjs.io/docs/snapshot-testingexamples/testing/timer-mocks.md → https://jestjs.io/docs/timer-mocksexamples/testing/es6-class-mocks.md → https://jestjs.io/docs/es6-class-mocks配置:
examples/configuration/jest-config.md → https://jestjs.io/docs/configurationexamples/configuration/cli-options.md → https://jestjs.io/docs/cliAPI 参考:
api/expect.md → https://jestjs.io/docs/expectapi/mock-functions.md → https://jestjs.io/docs/mock-functionsapi/jest-object.md → https://jestjs.io/docs/jest-objectapi/test.md → https://jestjs.io/docs/api#testname-fn-timeoutapi/cli.md → https://jestjs.io/docs/cli此技能包含详细的示例,其组织方式与官方文档结构相匹配。所有示例都在 examples/ 目录中(参见上面的映射)。
使用示例:
使用模板:
templates/ 目录中的模板以获取通用脚手架Jest, testing, unit test, integration test, mock, spy, snapshot, matcher, assertion, async test, setup, teardown, coverage, CLI, configuration, TypeScript, React, Vue, Babel, 测试, 单元测试, 集成测试, Mock, 快照, 匹配器, 断言, 异步测试, 覆盖率, 配置
每周安装数
60
仓库
GitHub 星标数
255
首次出现
2026年1月24日
安全审计
安装在
gemini-cli50
opencode50
codex47
github-copilot46
cursor43
amp40
代码审查最佳实践指南:完整流程、安全与性能审查清单
12,400 周安装
社交媒体经理技能:战略规划、平台选择与内容管理完整指南 | 营销自动化
34 周安装
Node.js/Python/Go性能分析器:火焰图、内存泄漏检测、负载测试与数据库优化
34 周安装
task-runner任务运行器:使用just简化项目命令执行,替代make的跨平台工具
34 周安装
Monorepo 导航器:Turborepo、Nx、pnpm Workspaces 管理工具,优化构建与发布
38 周安装
邮件序列设计指南:自动化滴灌营销、新用户引导与生命周期培育流程
35 周安装
Bitget CLI 工具:一站式加密货币交易命令行接口,支持现货合约杠杆跟单
36 周安装