🛑 The Problem
The Inngest worker that fetches GitHub data is the absolute core of our platform. However, because it relies on the live GitHub API, we cannot run it in CI/CD pipelines reliably without hitting rate limits or dealing with network flakes. We need to prove our database insertion logic works without touching the real internet.
💡 The Solution
Write a robust integration test that uses MSW (Mock Service Worker) or Jest/Vitest mocking to intercept the Octokit network requests and return a static JSON fixture of fake commits.
🛠️ Implementation Details
- Create a JSON fixture containing 5 realistic GitHub commit payloads.
- In a new Vitest file, mock the Octokit client to resolve with the fixture.
- Instantiate an in-memory or ephemeral Postgres test database.
- Call the Inngest function handler directly (bypassing the Inngest server).
- Query the test database and assert that exactly 5 rows were inserted with the correct mapped data.
✅ Acceptance Criteria
Ready to tackle this? Comment .take below to get automatically assigned!
🛑 The Problem
The Inngest worker that fetches GitHub data is the absolute core of our platform. However, because it relies on the live GitHub API, we cannot run it in CI/CD pipelines reliably without hitting rate limits or dealing with network flakes. We need to prove our database insertion logic works without touching the real internet.
💡 The Solution
Write a robust integration test that uses MSW (Mock Service Worker) or Jest/Vitest mocking to intercept the Octokit network requests and return a static JSON fixture of fake commits.
🛠️ Implementation Details
✅ Acceptance Criteria
Ready to tackle this? Comment
.takebelow to get automatically assigned!