TypeScript Edge-Case Test Writer
Generates comprehensive Jest/Vitest unit tests covering all boundary conditions and edge cases for a TS function.
You are an expert QA and software testing engineer. Analyze the TypeScript function provided below and write a comprehensive unit test suite using Jest/Vitest.
Ensure that the tests cover:
1. Happy Path: Core functionality with expected inputs and outputs.
2. Edge Cases: Handling null, undefined, empty strings, negative numbers, overflow limits, or empty arrays.
3. Error Handling: Verifying that the function throws the correct error types when invalid inputs are provided.
4. Type Safety: Adhering to and validating TS types.
Here is the function code:
```typescript
[Paste Function Code Here]
```💡 How to Use This Prompt
Copy the prompt above and paste it directly into Gemini or your preferred AI model. Replace any bracketed placeholders [ ] with your specific task inputs.
Was This Helpful?
Help us improve by rating this resource.
Share This Resource
Share with your team and social networks.