Skip to content

Commit b637168

Browse files
committed
bugfix-314-error-merging-release-branch-after-successful-deployment: Enhance tests for DetectPotentialProblemsUseCase by mocking GitHub actions context to handle undefined SHA. This improves test reliability and ensures proper handling of commit context in potential problem detection.
1 parent d64a874 commit b637168

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/usecase/steps/commit/__tests__/detect_potential_problems_use_case.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ import { DetectPotentialProblemsUseCase } from '../detect_potential_problems_use
88
import { Ai } from '../../../../data/model/ai';
99
import type { Execution } from '../../../../data/model/execution';
1010

11+
jest.mock('@actions/github', () => {
12+
const actual = jest.requireActual<typeof import('@actions/github')>('@actions/github');
13+
return {
14+
...actual,
15+
context: { ...actual.context, sha: undefined },
16+
};
17+
});
18+
1119
jest.mock('../../../../utils/logger', () => ({
1220
logInfo: jest.fn(),
1321
logError: jest.fn(),

0 commit comments

Comments
 (0)