🧪 Skills

Test Case Generator

Automatically generate complete unit test code including imports, test cases, mocks, and assertions for Jest, Mocha, or Pytest from given code.

v1.0.0
❤️ 0
⬇️ 593
👁 1
Share

Description

Test Case Generator

根据代码自动生成单元测试用例。

功能

  • 从代码提取函数签名
  • 自动生成测试框架代码
  • 支持 Jest、Mocha、Pytest
  • 智能生成测试参数

触发词

  • "生成测试"
  • "测试用例"
  • "unit test"
  • "generate test"

支持框架

// Jest
test('functionName should work', () => {
  expect(result).toBe(expected);
});

// Mocha
it('functionName', () => {
  assert(result === expected);
});

// Python Pytest
def test_function_name():
    assert result is not None

输出

返回完整的测试文件代码,包含:

  • 导入语句
  • 测试用例
  • Mock 数据
  • 断言

Reviews (0)

Sign in to write a review.

No reviews yet. Be the first to review!

Comments (0)

Sign in to join the discussion.

No comments yet. Be the first to share your thoughts!

Compatible Platforms

Pricing

Free

Related Configs