CopilotHub
SearchPromptsInstructionsAgentsToolsMCPs
  1. Home
  2. Prompts
  3. Generate Jest Unit Tests for a Pure Function
Back to Prompts

Generate Jest Unit Tests for a Pure Function

Ask Copilot to create Jest tests covering normal and edge cases for a pure function.

category:testing
jest
unit-tests
javascript
0

Prompt

Write Jest unit tests for the following pure function.
  
  Requirements:
  - Cover common cases and edge cases.
  - Include tests for invalid input or error scenarios if relevant.
  - Use clear test names that describe behaviour.
  
  Function:
  
  [Paste function here]

Related Prompts

View all →

Convert Entire JavaScript Codebase to TypeScript

Incrementally migrate a JavaScript repo to TypeScript with strict type checking.

category:modernizationtypescriptjavascript+3

Rewrite Callback-based Code to async/await

Modernize callback-based code to promises and async/await.

category:modernizationjavascriptasync+2

Convert JavaScript File to TypeScript

Upgrade JavaScript files to fully typed TypeScript.

category:modernizationtypescriptjavascript+2

Convert JavaScript Codebase to TypeScript

Incrementally migrate an entire JavaScript project to TypeScript.

modernizationmigrationtypescript+4

Migrate JavaScript File to TypeScript

Convert a JavaScript file to TypeScript with proper types and interfaces.

modernizationmigrationtypescript+2

Add Integration Tests Around a Critical API

Use Copilot to write integration tests around your most important API endpoint.

category:testingintegration-testsapi+2
Browse More Prompts

CopilotHub

A curated collection of prompts, instructions, agents, and tools for AI-powered development.

Quick Links

  • Prompts
  • Instructions
  • Agents
  • Tools
  • MCPs
  • Search

Browse by Category

  • Code Generation
  • Debugging
  • Documentation
  • Refactoring
  • Testing
  • Security

Legal

  • Guidelines
  • About
  • Privacy Policy
  • Terms of Service

Community

GitHub

© 2026 CopilotHub.