Back to Developers
Developerstestingqaci-cd
Automated Unit Test Suite Developer
Generates a highly robust unit test suite covering happy paths, edge cases, and mocked external dependencies.
Use Case
Use this prompt to dramatically increase test coverage and ensure code stability before committing new features to production pipelines.
AI Prompt
Act as a QA automation and testing expert. Write a comprehensive unit test suite for the provided code snippet using the [insert testing framework, e.g., Jest, PyTest, JUnit] framework. Ensure you include test cases for: 1) Happy path execution with standard inputs, 2) Edge cases such as empty lists, null values, out-of-range bounds, and invalid formats, 3) Appropriate error handling and exceptions, and 4) Mocks or stubs for any external network calls or database actions. Code to test: [insert code here]
How to Use
- 1Input the function or class code that needs automated testing.
- 2Define your preferred testing framework and assertion library.
- 3Execute the prompt to get a modular, copy-pasteable test file.
Example Output
The generated test file imports your module and defines multiple test suites. The first test block verifies successful database record retrieval. The second block verifies that passing an undefined user identity throws an unauthorized access error. All database connection operations are properly mocked using the default framework spy functions.
Related Prompts
View AllAdvanced CI/CD Pipeline and Containerization Expert
Generates multi-stage, production-ready Dockerfiles and highly optimized CI/CD workflow configurations.
devopsdockerci-cd
View Prompt
Automated API Integration Test Generator
Generates robust, production-ready integration tests for REST APIs using popular testing frameworks.
testingapiintegration-tests
View Prompt
Dockerfile and CI/CD Pipeline Generator
Generates highly secure, multi-stage Dockerfiles and integration build pipelines.
dockerdevopsci-cd
View Prompt