Token导航 LogoToken导航TokenDH.com
开发external-servicegithub未标认证来源可访问clear审计通过

jestjest 开发

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

1,523

周安装

61

GitHub Stars

347

下载量

493
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:jest(jest 开发)
来源仓库:https://github.com/teachingai/full-stack-skills
仓库路径:skills/jest
安装命令:
npx skills add https://github.com/teachingai/full-stack-skills --skill jest
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/teachingai/full-stack-skills --skill jest

简介

用于辅助测试设计、自动化测试和回归验证。

  • 适合编写单元测试、端到端测试或根据失败日志定位问题。
  • 使用时确认项目测试框架、运行命令和夹具数据。
  • 安装命令:npx skills add https://github.com/teachingai/full-stack-skills --skill jest。
  • 涉及浏览器或外部服务时应区分本地模拟与生产环境。

SKILL.md

When to use this skill

Use this skill whenever the user wants to:

  • Write unit tests and integration tests with Jest
  • Set up Jest in a project
  • Use Jest matchers and assertions
  • Test asynchronous code
  • Mock functions, modules, and dependencies
  • Create snapshot tests
  • Configure Jest for different environments
  • Use Jest with TypeScript, React, Vue, or other frameworks
  • Run tests and generate coverage reports
  • Use Jest CLI commands
  • Set up test environments (jsdom, node)
  • Use Jest with Vite (via vite-jest, though Vitest is recommended for new Vite projects)

How to use this skill

This skill is organized to match the Jest official documentation structure (https://jestjs.io/docs/getting-started, https://jestjs.io/docs/api). When working with Jest:

  1. Identify the topic from the user's request:

- Getting started/快速开始 → examples/getting-started/installation.md or examples/getting-started/using-matchers.md - Testing/测试 → examples/testing/asynchronous.md or examples/testing/setup-teardown.md - Mock functions/Mock 函数 → examples/testing/mock-functions.md - Mock modules/Mock 模块 → examples/testing/manual-mocks.md - Snapshots/快照 → examples/testing/snapshot-testing.md - Configuration/配置 → examples/configuration/jest-config.md - CLI/命令行 → examples/configuration/cli-options.md

  1. Load the appropriate example file from the examples/ directory: Getting Started (快速开始) - examples/getting-started/: Testing (测试) - examples/testing/: Configuration (配置) - examples/configuration/: Guides (指南) - examples/guides/:

- examples/getting-started/installation.md - Installing Jest and basic setup - examples/getting-started/using-matchers.md - Using Jest matchers and assertions - examples/testing/asynchronous.md - Testing asynchronous code - examples/testing/setup-teardown.md - Setup and teardown functions - examples/testing/mock-functions.md - Mocking functions - examples/testing/manual-mocks.md - Manual mocks - examples/testing/snapshot-testing.md - Snapshot testing - examples/testing/timer-mocks.md - Mocking timers - examples/testing/es6-class-mocks.md - Mocking ES6 classes - examples/configuration/jest-config.md - Jest configuration options - examples/configuration/cli-options.md - CLI options and flags - examples/configuration/babel.md - Using Jest with Babel - examples/configuration/typescript.md - Using Jest with TypeScript - examples/guides/migrating-to-jest.md - Migrating to Jest - examples/guides/testing-react-apps.md - Testing React applications - examples/guides/testing-vue-apps.md - Testing Vue applications

  1. Follow the specific instructions in that example file for syntax, structure, and best practices Important Notes:

- All examples follow Jest best practices - Examples include both JavaScript and TypeScript versions where applicable - Each example file includes key concepts, code examples, and key points - Always check the example file for best practices and common patterns

  1. Reference API documentation in the api/ directory when needed:

- api/expect.md - expect() API and matchers - api/mock-functions.md - Mock functions API - api/jest-object.md - Jest object API - api/test.md - test() and describe() API - api/cli.md - CLI commands and options

  1. Use templates from the templates/ directory:

- templates/jest-config.md - Jest configuration templates - templates/test-template.md - Test file templates - templates/setup-file.md - Setup file templates

Doc mapping (one-to-one with https://jestjs.io/docs/getting-started, https://jestjs.io/docs/api)

Getting Started (快速开始):

Testing (测试):

Configuration (配置):

API Reference:

Examples and Templates

This skill includes detailed examples organized to match the official documentation structure. All examples are in the examples/ directory (see mapping above).

To use examples:

  • Identify the topic from the user's request
  • Load the appropriate example file from the mapping above
  • Follow the instructions, syntax, and best practices in that file
  • Adapt the code examples to your specific use case

To use templates:

  • Reference templates in templates/ directory for common scaffolding
  • Adapt templates to your specific needs and coding style

Best Practices

  1. Write descriptive test names: Use clear, descriptive test names
  2. Use appropriate matchers: Choose the right matcher for each assertion
  3. Mock external dependencies: Mock external APIs, databases, and services
  4. Test edge cases: Test both happy paths and error cases
  5. Keep tests isolated: Each test should be independent
  6. Use setup and teardown: Clean up resources properly
  7. Snapshot testing: Use snapshots for UI components, but review changes
  8. Coverage goals: Aim for meaningful coverage, not just high percentages
  9. Organize tests: Group related tests using describe blocks
  10. Async testing: Properly handle async code with async/await or promises

Resources

Keywords

Jest, testing, unit test, integration test, mock, spy, snapshot, matcher, assertion, async test, setup, teardown, coverage, CLI, configuration, TypeScript, React, Vue, Babel, 测试, 单元测试, 集成测试, Mock, 快照, 匹配器, 断言, 异步测试, 覆盖率, 配置

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.6%
按下载量换算141

OpenCode

20.73%
按下载量换算102

Antigravity

17.11%
按下载量换算84

Gemini CLI

12.06%
按下载量换算59

windsurf

7.22%
按下载量换算36

trae

3.23%
按下载量换算16

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills