Skip to content

Commit 972db5b

Browse files
committed
fix(mokcedRequests): clear all comments before testing github issue comments api
1 parent a865eab commit 972db5b

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

packages/core/tests/mockedRequests.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,23 @@ describe('GitHub API Integration Tests', () => {
4545
});
4646

4747
it('Should create and list issue comments with the expected structure', async () => {
48+
const { data: existingComments } = await octokit.issues.listComments({
49+
...TEST_REPO,
50+
issue_number: TEST_ISSUE_NUM,
51+
per_page: 100,
52+
});
53+
54+
for (const comment of existingComments) {
55+
try {
56+
await octokit.issues.deleteComment({
57+
...TEST_REPO,
58+
comment_id: comment.id,
59+
});
60+
} catch {
61+
// noop
62+
}
63+
}
64+
4865
const commentBody = 'Test Comment';
4966
const { data: createdComment } = await octokit.issues.createComment({
5067
...TEST_REPO,

0 commit comments

Comments
 (0)