← Back to Skills Marketplace
Test Case Generator
by
HonestQiao
· GitHub ↗
· v1.0.0
1347
Downloads
1
Stars
17
Active Installs
1
Versions
Install in OpenClaw
/install test-case-generator
Description
Automatically generate complete unit test code including imports, test cases, mocks, and assertions for Jest, Mocha, or Pytest from given code.
Usage Guidance
This skill is coherent and doesn't request credentials or installs; it simply generates test-source text from code you provide. Before using generated tests, review them manually — especially any mocks or injections — and avoid running generated tests against sensitive systems or secrets without inspection. Also note the skill's source/homepage are unknown; if you plan to rely on it heavily, prefer a skill with a verifiable author or open source implementation you can audit.
Capability Analysis
Type: OpenClaw Skill
Name: test-case-generator
Version: 1.0.0
The `skill.yaml` implementation for `generateTests` directly interpolates extracted function names (`fn.name`) and parameters (`fn.params`) into the generated test code strings without apparent sanitization. This creates a code injection vulnerability in the *output* of the skill. If the input `code` contains malicious strings in function names or parameters, these could be embedded into the generated test files, potentially leading to arbitrary code execution when a user runs the generated tests. This is a significant vulnerability due to lack of input sanitization, but it does not demonstrate intentional malicious behavior by the skill itself.
Capability Assessment
Purpose & Capability
The name/description (generate unit tests for Jest/Mocha/Pytest) match the instructions and the small implementation template in skill.yaml. No unrelated permissions, binaries, or credentials are requested.
Instruction Scope
SKILL.md and the implementation only describe taking code as input and returning test-file source (imports, mocks, assertions). There are no instructions to read system files, environment variables, or to execute user code or transmit data to external endpoints.
Install Mechanism
No install spec is present (instruction-only), so nothing is written to disk or downloaded. This is the lowest-risk install profile and is appropriate for the stated purpose.
Credentials
The skill requires no environment variables, credentials, or config paths. That is proportional to a code-to-test-generator that operates on provided code strings.
Persistence & Privilege
The skill is not always-enabled and requests no elevated privileges or modification of other skills/config; autonomous invocation is allowed by default but is not combined with other concerning capabilities.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install test-case-generator - After installation, invoke the skill by name or use
/test-case-generator - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of Test Case Generator skill.
- Automatically extracts function signatures from code.
- Generates unit test code for Jest, Mocha (JavaScript), and Pytest (Python).
- Supports intelligent generation of test parameters and mock data.
- Responds to trigger phrases such as "生成测试", "测试用例", "unit test", and "generate test".
- Outputs a complete test file including imports, test cases, mocks, and assertions.
Metadata
Frequently Asked Questions
What is Test Case Generator?
Automatically generate complete unit test code including imports, test cases, mocks, and assertions for Jest, Mocha, or Pytest from given code. It is an AI Agent Skill for Claude Code / OpenClaw, with 1347 downloads so far.
How do I install Test Case Generator?
Run "/install test-case-generator" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Test Case Generator free?
Yes, Test Case Generator is completely free (open-source). You can download, install and use it at no cost.
Which platforms does Test Case Generator support?
Test Case Generator is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Test Case Generator?
It is built and maintained by HonestQiao (@honestqiao); the current version is v1.0.0.
More Skills