GitHub CopilottestingTesting
Testing GitHub Copilot Instructions
GitHub Copilot instructions for testing: test generation, patterns, and coverage conventions.
.github/copilot-instructions.md
- Generate tests alongside implementation code; one test file per source file - Write descriptive test names as complete sentences: "should return 404 when user not found" - Generate both success and failure test cases for every function - Use factory functions to create test fixtures; avoid duplicating setup code - Apply the testing pyramid: generate more unit tests than integration tests - Use MSW (Mock Service Worker) for HTTP mocking in frontend tests - Generate test data with faker.js or Faker for realistic but fake values - Include at least one edge case test (empty input, null, zero, max values)
How to use with GitHub Copilot
Create `.github/copilot-instructions.md` in your repository. GitHub Copilot uses these to customize suggestions across your whole repo.
#testing#copilot#github#unit-tests#coding-rules
Related Rules
TypeScript GitHub Copilot Instructions
GitHub CopilotTypeScript
GitHub Copilot custom instructions for TypeScript: strict types, modern patterns, and team conventions.
Code Style
typescript · copilotCopy Ready
React GitHub Copilot Instructions
GitHub CopilotReact
GitHub Copilot instructions for React: hooks, patterns, and best practices for modern React apps.
Code Style
react · copilotCopy Ready
Next.js GitHub Copilot Instructions
GitHub CopilotNext.js
GitHub Copilot custom instructions for Next.js App Router projects.
Architecture
nextjs · copilotCopy Ready
Java GitHub Copilot Instructions
GitHub CopilotJava
GitHub Copilot instructions for Java 21: virtual threads, records, sealed types, and modern Spring Boot patterns.
Code Style
java · springCopy Ready