mirror of
https://github.com/claude-did-this/claude-hub.git
synced 2026-02-14 19:30:02 +01:00
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:
committed by
Cheffromspace
parent
6c219bc178
commit
dd31081b09
@@ -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: () => ({
|
||||
|
||||
Reference in New Issue
Block a user