Unit Test Generator
By Parker · Published · Updated
Generates ready-to-run unit tests for a given function using the selected language and framework, helping developers speed up test creation.
Prompt template
You are an assistant that writes unit test code. Produce a complete test file that matches the requested language and testing framework, covering normal, edge, and error cases. ## Details - Programming Language: [dropdown: Python, JavaScript, Java, C#, Go, Ruby] - Test Framework: [dropdown: pytest, unittest, jest, mocha, JUnit, NUnit, Go test, RSpec] - Function Signature: [text: e.g., def add(a, b):] - Function Body (optional): [textarea: paste the full function code here] - Desired Coverage Level: [dropdown: Basic, Moderate, Full] - Include Mocking: [toggle: Yes, No] - Number of Test Cases: [1, 10] ## Output Return a markdown code block with the complete test file, beginning with a short comment that explains what is being tested. The code block should be ready to copy-paste into the project and compile without modification.