Fill in your details optional The prompt below updates as you type. What you type stays in this browser and is never sent to us.
You are an expert in this kind of work, and you know the Small Business & Shops sector from the inside.
## Your task
Write unit tests for the function below, used in a small business such as a shop, local service or home business with 1 to 20 people. Use [TEST FRAMEWORK]. Cover the normal path, edge cases (empty input, nulls, boundaries, large values) and expected failures. Name each test after the behaviour it checks, and add one line explaining any case that is not obvious.
## About my situation
- Who this is for: local customers, walk-in buyers and followers on WhatsApp and Instagram
- What we must respect: GST and local shop rules, a tight budget and very little staff time
- How we measure success: monthly sales and repeat customers
## What matters in Small Business & Shops
- Rules and standards that usually apply: GST registration, invoices and returns once turnover crosses the limit (in India); shop and establishment registration and local trade licences; FSSAI licence for anything involving food; consumer-protection rules on prices, MRP and refunds; consent before adding people to WhatsApp or SMS broadcast lists.
- Common risks to plan for: cash running short; customers who do not pay their credit; big chains and online sellers undercutting prices; one bad review hurting sales; the owner being too busy to market.
- Tools commonly used: WhatsApp Business; Google Business Profile; Instagram; UPI apps and QR codes; billing apps such as Vyapar, Khatabook or Tally; Canva.
- Words people in this field use: GST invoice; MRP; udhaar (credit to customers); stock; walk-in; WhatsApp Business catalogue; Google Business Profile; UPI.
- Rules differ by country. If I have not said where I work, ask me, and do not present one country's law as if it applied everywhere.
## What I will give you
Function:
[PASTE FUNCTION]
## How to work through it
1. Explain what the function should do, including its inputs and outputs.
2. List the normal cases, edge cases and failure cases before writing any test.
3. Write the tests, one behaviour per test, named after that behaviour.
4. Add mocks or fixtures only where the function touches the outside world.
5. Point out any bug the tests reveal.
## What to deliver
- A list of test cases grouped by normal, edge and failure
- The complete test file, ready to run
- How to run the tests
- Any bugs found
## Rules
- Make every point specific to my situation and my industry; replace generic advice with detail that fits.
- Use plain language, short sentences, and tables where they make the answer easier to scan.
- Use only the facts I give you. Do not invent figures, laws, sources or quotes. Mark anything you had to assume with "Assumption:".
- If something important is missing, ask me up to 3 short questions before you start.
## Before you answer
Check your draft against this list and fix anything that fails:
- The code works as written: no invented libraries, functions or APIs, and versions are named where they matter.
- It is written for a small business such as a shop, local service or home business with 1 to 20 people; nothing in it would read the same for any other business.
- Nothing in it breaks GST and local shop rules, a tight budget and very little staff time.
- Every item under "What to deliver" is included.
How to use this prompt
- Copy the prompt. Press Copy prompt and the full text goes to your clipboard.
- Fill the brackets. Use the form above, or replace [TEST FRAMEWORK], [PASTE FUNCTION] with your own details.
- Paste and send. Paste it into ChatGPT, Claude, Microsoft Copilot and DeepSeek and send. Ask follow-up questions to refine the answer.
Why use this Unit tests for a function prompt?
This unit tests for a function prompt is written for a small business such as a shop, local service or home business with 1 to 20 people. It tells the assistant who the answer is for (local customers, walk-in buyers and followers on WhatsApp and Instagram) and the limits it must respect: GST and local shop rules, a tight budget and very little staff time. That context is what turns a generic reply into one a Small Business & Shops team can use straight away.
Most people type a single line and get a generic answer back. This prompt gives the assistant the role, the context and the structure it needs, so the first answer is already close to what you would hand to your team. Because it is written for Small Business & Shops, it keeps the focus on what that industry measures: monthly sales and repeat customers.
How to get the best answer
- Be specific in the brackets: real names, numbers and dates give a far better answer than placeholders.
- Paste real material: where the prompt asks for notes, data or text, paste the actual content rather than a summary.
- Refine in the same chat: ask "make it shorter", "turn it into a table" or "add more detail on step 2".
- Check the result: review it against what you know about monthly sales and repeat customers before you share it.
Other industries
Same prompt for other industries
The same unit tests for a function prompt, rewritten for each industry.
FAQ
Frequently asked questions
Which AI assistant works best with this Unit tests for a function prompt?
It works in any chat assistant. It suits ChatGPT, Claude, Microsoft Copilot and DeepSeek best. Paste it in, send it, and ask follow-up questions in the same chat.
What do I need to replace before sending it?
Replace the 2 highlighted brackets – [TEST FRAMEWORK], [PASTE FUNCTION] – with your own details. The more specific you are, the better the answer.
Is this prompt only for Small Business & Shops?
This version is written for a small business such as a shop, local service or home business with 1 to 20 people. The same prompt is also available for 15 other industries, listed on this page.
Is it free to use?
Yes. Copy it as often as you like and use it in your own work. No sign-up is needed.
Can I trust the answer?
Treat it as a strong first draft. Check facts and figures yourself, especially anything with legal, financial, medical or safety consequences.
Keep exploring
Browse more Small Business & Shops prompts
- All Small Business & Shops prompts
- Project Managementfor Small Business & Shops
- Marketing & Contentfor Small Business & Shops
- SEOfor Small Business & Shops
- Salesfor Small Business & Shops
- Customer Supportfor Small Business & Shops
- Data Analysisfor Small Business & Shops
- Business Strategyfor Small Business & Shops
- Operationsfor Small Business & Shops
- Browse the full library