← 返回
未分类 中文

Skylv Test Writer

Auto-generates unit tests and integration tests from source code. Supports Jest, Pytest, Mocha. Triggers: write tests, generate tests, unit test, test covera...
自动从源代码生成单元测试和集成测试,支持 Jest、Pytest、Mocha。触发词:写测试、生成测试、单元测试、测试覆盖...
sky-lv sky-lv 来源
未分类 clawhub v1.0.0 1 版本 99746.8 Key: 无需
★ 0
Stars
📥 394
下载
💾 1
安装
1
版本
#latest

概述

Test Writer

Overview

Analyzes source code and auto-generates comprehensive unit and integration tests.

When to Use

  • User asks to "write tests" or "add test coverage"
  • User wants to "test this function"

How It Works

Step 1: Detect test framework

Check: package.json (jest/mocha), pytest.ini, pyproject.toml, conftest.py

Step 2: Parse source

Read source files. Identify: function signatures, parameters, return types, error handling, edge cases.

Step 3: Generate test cases

For each function generate: happy path, edge cases (empty/null/zero), error cases, boundary cases.

Step 4: Write test file

JavaScript: __tests__/filename.test.js or filename.test.js

Python: tests/test_filename.py

Templates

Jest

describe('functionName', () => {

test('should return expected result', () => {

expect(functionName(input)).toBe(expected);

});

test('should throw for invalid input', () => {

expect(() => functionName(invalid)).toThrow();

});

});

Pytest

def test_function_normal():

assert function_name(input) == expected

def test_function_invalid():

with pytest.raises(ErrorType):

function_name(invalid)

Tips

  • Target 80%+ coverage on critical functions
  • Cover all branches and error paths
  • Mock external dependencies (API, filesystem, DB)

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 05:21 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 72 📥 181,533
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 677 📥 326,212
dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 195 📥 67,448