Back to All Prompts
GeminiSoftware

TypeScript Edge-Case Test Writer

Generates comprehensive Jest/Vitest unit tests covering all boundary conditions and edge cases for a TS function.

SYSTEM PROMPT INSTRUCTION
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.

"TypeScript Edge-Case Test Writer" AI Prompt Layout & Best Practices

Structuring your input correctly is the most important step in prompt design. The "TypeScript Edge-Case Test Writer" template showcased on this page is custom-built to resolve tasks under the "Software" category.

By deploying "Gemini"'s logical reasoning capacities, this template automates repetitive tasks. Edit the bracketed placeholders to make it specific to your targets.

All prompt templates on our platform use advanced system variables like role playing and output formatting rules to ensure corporate-level output standards.

For best results, we suggest running this prompt on the latest AI engine revisions and reviewing the generated outputs for factual accuracy.

Frequently Asked Questions (FAQ)

While specifically optimized for "Gemini", it is highly compatible with ChatGPT, Anthropic Claude, Google Gemini, and Llama.
Simply replace the bracketed placeholders [...] with your project details, such as target audience, programming language, or tone.
We recommend using premium versions such as ChatGPT Plus, Claude 3.5 Sonnet, or Gemini Pro for highly consistent and structured content.