Welcome to the GitHub Copilot Testing Challenge! This exercise is designed to help you practice using GitHub Copilot for test-driven development and various testing scenarios.
This challenge consists of 3 progressively difficult exercises that will help you explore:
- Writing unit tests with GitHub Copilot
- Test-Driven Development (TDD)
- Integration testing
- Mock creation and usage
- Improving test coverage
- Approximately 20 minutes total
- Each challenge should take about 6-7 minutes
- Basic Unit Testing - String manipulation and basic assertions
- Intermediate Testing - Working with mocks and async operations
- Advanced Testing - Integration testing and complex scenarios
There are two ways to get started:
- Click the "Code" button above
- Select "Create codespace on main"
- Wait for the codespace to be created and VS Code to load
- When prompted, install the recommended CodeTour extension
- Open the Command Palette (F1 or Ctrl/Cmd+Shift+P)
- Type "CodeTour: Start Tour" and select it
- Follow the guided tour through each challenge
- Clone this repository
- Install dependencies with
npm install - Start with Challenge 1 and progress through each challenge
- Use GitHub Copilot to help you write tests and implement solutions
- Run tests using
npm test
This repository includes a CodeTour that will walk you through each challenge step by step. To use it:
- Make sure you have the CodeTour extension installed in VS Code
- Look for the CodeTour panel in your sidebar or use the Command Palette to "Start Tour"
- Follow along with the interactive guide that will help you navigate through each challenge
- Use Copilot Chat to ask questions about testing approaches
- Try using Copilot to generate test cases
- Use Copilot to help implement the actual functions based on your tests
- Experiment with Copilot's test generation capabilities
Good luck and happy coding! 🎉