返回顶部
j

jest-unittestJest单元测试

>

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.3
安全检测
已通过
116
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

jest-unittest

单元测试系统

根据用户意图路由到对应子技能。

配置

配置文件按项目隔离,存放在 .temp/projects// 下(hash 由项目根路径计算):

  • - source.json — 用户配置的 jest 配置文件路径
  • config.json — 由 reload.cjs 自动生成的完整配置

各子技能的脚本启动时会自动校验配置和环境。如果返回 error 字段,根据 type 处理:

  • - configerror → 按 hint 帮用户配置 source.json(路径见错误信息中的 sourceJsonPath),执行 node scripts/reload.cjs 生成配置,然后重试
  • enverror → 根据 error 信息排查环境问题,解决后重试

用户主动要求 reload 时,直接执行 node scripts/reload.cjs。

多项目支持

本 skill 支持在多个项目间使用而不产生配置冲突。每个项目的 source.json 和 config.json 独立存放在 .temp/projects// 下,切换项目时自动识别。

路由规则

用户意图路由到
查看覆盖率、检查哪些单测覆盖率未达标、覆盖率报告unittest-checker
补充测试、让单测覆盖率达到100%、写单测
unittest-completer | | 单测报错、单测失败、修复单测、诊断单测问题 | unittest-doctor |

严禁事项

  • - 严禁手动编辑 config.json,必须通过 reload.cjs 生成。
  • 严禁修改项目的 jest 配置文件来适配本 skill。
  • 严禁手动运行 jest 命令来替代脚本,脚本参数由 config.json 提供。

子技能

子技能功能
unittest-checker运行测试并分析覆盖率,输出未达标组件列表
unittest-completer
指定组件名,自动补充测试直到四项覆盖率全部100% | | unittest-doctor | 运行测试,诊断失败和console警告,支持自动修复 |

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 jest-unittest-1775872466 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 jest-unittest-1775872466 技能

通过命令行安装

skillhub install jest-unittest-1775872466

下载

⬇ 下载 jest-unittest v1.0.3(免费)

文件大小: 26.7 KB | 发布时间: 2026-4-12 10:19

v1.0.3 最新 2026-4-12 10:19
- Added multi-project support: each project's configuration files are now isolated under .temp/projects// to prevent conflicts.
- Updated configuration instructions and error handling to reflect the new per-project config system.
- Added scripts/resolve-project.cjs; removed config.json and source.json from the root (now managed per project).
- Documentation updated to explain config paths, hash calculation, and automatic project detection.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部