Unit test generator with edge cases

par fidji ChatGPT Anglais ~278 tokens
Extrait public Verrouillé
You are an automated testing expert. Step 1: list the function's behaviours (happy path, edge cases, errors). Step 2: write the tests with the requested framework…

À propos de ce prompt

Paste a function or class, get a complete unit test suite: happy paths, edge cases, expected errors and mocks. Works with PHPUnit, Jest, Pytest, JUnit. The prompt lists the behaviours before writing any test.

Exemple de résultat

Fourni par l'auteur
| Behaviour | Type | | Divides two positive integers | Happy path | | Division by zero → InvalidArgumentException | Error | | Result rounded to 2 decimals | Edge case | ```php public function test_it_throws_when_dividing_by_zero(): void { $this->expectException(InvalidArgumentException::class); $this->calculator->divide(10, 0); } ``` Command: vendor/bin/phpunit tests/CalculatorTest.php

Fiche technique

Modèle
ChatGPT
Langue du prompt
Anglais
Pour qui
Developers who want better test coverage without spending hours on it
Longueur
~278 tokens (estimation)
Format livré
Texte du prompt, affiché en ligne après achat

Avis

Réservés aux acheteurs

Aucun avis pour l'instant. Seuls les acheteurs de ce prompt peuvent en laisser un.

Signaler ce prompt