test: Add Octokit mock to fix Jest module resolution

- Mock @octokit/rest module to prevent ES module import errors in Jest
- Provide mock implementations for all Octokit methods used in tests
- Tests now pass with the new Octokit-based implementation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jonathan Flatt
2025-05-23 00:34:37 +00:00
committed by Cheffromspace
parent 6c219bc178
commit dd31081b09

View File

@@ -1,3 +1,21 @@
// Mock Octokit before requiring modules that use it
jest.mock('@octokit/rest', () => ({
Octokit: jest.fn().mockImplementation(() => ({
issues: {
createComment: jest.fn(),
addLabels: jest.fn(),
createLabel: jest.fn(),
removeLabel: jest.fn()
},
pulls: {
listReviews: jest.fn()
},
repos: {
getCombinedStatusForRef: jest.fn()
}
}))
}));
// Mock the logger before requiring other modules
jest.mock('../../../src/utils/logger', () => ({
createLogger: () => ({