Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计通过

analyzing-test-coverage分析测试覆盖率

Agent Skill

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

总安装

428

周安装

18

GitHub Stars

28

下载量

150
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/saleor/configurator --skill analyzing-test-coverage

简介

指导单元测试、集成测试与端到端用例编写。

  • 遵循 Vitest、MSW 等项目特定测试规范。
  • 协助设置模拟处理器与夹具数据管理。
  • 适用于回归测试与覆盖率缺口修复。analyzing-test-coverage 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 需确认本地测试环境与外部服务隔离策略。

SKILL.md

Testing Strategy Analyst

Overview

Guide the creation of comprehensive tests following project patterns for unit tests, integration tests, and E2E tests using Vitest, MSW, and project-specific test helpers.

When to Use

  • Writing new tests for entities or services
  • Analyzing test coverage gaps
  • Setting up mocks (MSW handlers, vi.fn)
  • Organizing test files in the module structure
  • Debugging test failures

Testing Stack

ToolPurpose
VitestTest runner and assertion library
MSWMock Service Worker for network mocking
viVitest mock utilities
test-helpers/Project-specific test utilities

Test Organization

src/
├── modules/
│   └── category/
│       ├── category-service.ts
│       ├── category-service.test.ts        # Unit tests
│       ├── repository.ts
│       ├── repository.test.ts              # Repository tests
│       └── category.integration.test.ts    # Integration tests
├── core/
│   └── diff/
│       └── comparators/
│           ├── category-comparator.ts
│           └── category-comparator.test.ts
├── test-helpers/
│   ├── config-file-builder.ts
│   ├── graphql-mocks.ts
│   ├── config-fixtures.ts
│   └── cli-runner.ts
└── lib/
    └── test-setup.ts                       # Global test setup

e2e/
└── ...                                     # End-to-end tests

Quick Pattern Reference

Service Tests

See references/patterns.md for full examples. Key structure:

  • Declare dependencies at suite level
  • Reset mocks in beforeEach with vi.clearAllMocks()
  • Use describe blocks for method grouping
  • Follow Arrange-Act-Assert pattern

Repository Tests with MSW

See references/patterns.md for MSW setup. Key steps:

  1. Define handlers with graphql.query() / graphql.mutation()
  2. Setup server with beforeAll / afterAll
  3. Override handlers for specific test cases with server.use()

Test Data Builders

See references/test-builders.md for implementations. Pattern:

  • Create builder class with fluent interface
  • Validate with Zod schema in build()
  • Provide factory functions for convenience

Mock Functions

See references/patterns.md for examples. Common patterns:

  • vi.fn() for simple mocks
  • vi.mocked() for typed access
  • vi.mock() for module mocking

Running Tests

pnpm test                                    # All tests
pnpm test -- --filter=category-service       # Specific file
pnpm test -- --grep="should create category" # Pattern match
pnpm test -- --watch                         # Watch mode
pnpm test -- --coverage                      # With coverage

See references/commands-reference.md for advanced options and coverage configuration.

Test Quality Checklist

For Every Test

  • Follows Arrange-Act-Assert pattern
  • Has descriptive test name
  • Tests one thing per test
  • Includes both positive and negative cases
  • Uses typed mocks (not any)
  • Cleans up after itself (beforeEach/afterEach)

For Test Suites

  • Covers all public methods
  • Covers error scenarios
  • Covers edge cases
  • Uses schema-validated test data
  • Has integration tests for complex flows

Validation Checkpoints

PhaseValidateCommand
Test writtenFile existsCheck *.test.ts created
Tests passAll greenpnpm test <file>
Coverage adequateKey paths coveredpnpm test --coverage
Mocks typedNo any in mocksnpx tsc --noEmit

Common Mistakes

MistakeFix
Not resetting mocksAdd vi.clearAllMocks() in beforeEach
Testing implementation detailsTest behavior (public API output), not internal state
Flaky async testsAlways await async operations before asserting
Using any in mocksUse vi.mocked() for typed mock access
Missing error case testsAdd tests for rejection, validation failure, empty input

References

Skill Reference Files

  • references/patterns.md - Detailed test patterns with full code examples
  • references/test-builders.md - Builder pattern implementations
  • references/commands-reference.md - Complete command reference

Project Resources

  • {baseDir}/src/test-helpers/ - Test utilities
  • {baseDir}/vitest.config.ts - Test configuration
  • {baseDir}/docs/TESTING_PROTOCOLS.md - Testing protocols

External Documentation

Related Skills

  • Complete entity workflow: See adding-entity-types for E2E implementation including tests
  • Zod test patterns: See designing-zod-schemas for schema validation tests
  • GraphQL mocking: See writing-graphql-operations for MSW handlers

Quick Reference Rule

For a condensed quick reference, see .claude/rules/testing-standards.md (automatically loaded when editing *.test.ts files).

适合场景

01

研究助手

02

事实核查

03

知识库问答

04

带来源的搜索总结

能力概览

能力 1

组合搜索和大模型调用

能力 2

支持多来源检索和总结

能力 3

强调引用来源和事实核查

能力 4

适合研究型 Agent 流程

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

平台分布

Claude Code

27.8%
按下载量换算42

Antigravity

24.96%
按下载量换算37

windsurf

18.43%
按下载量换算28

trae

11.6%
按下载量换算17

OpenCode

7.82%
按下载量换算12

Codex

3.52%
按下载量换算5

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

来源信息

继续浏览同类 Skills