Skip to content

Commit

Permalink
removed unused test
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyscholl committed Oct 28, 2023
1 parent 3d572e7 commit 7bae815
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 38 deletions.
11 changes: 3 additions & 8 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,24 +157,19 @@ function markDiscussionCommentAnswer() {
yield (0, core_1.setFailed)("Comment reaction threshold has not been met to be considered an answer.");
return;
}
const response = yield markDiscussionAnswerCall(commentNodeId, token);
commentNodeId = result.commentId;
yield (0, core_1.setOutput)("commentText", result.commentText);
yield (0, core_1.setOutput)("reactionThreshold", Number(reactionThreshold));
yield (0, core_1.setOutput)("totalReactions", result.totalReactions);
yield (0, core_1.setOutput)("totalPositiveReactions", result.totalPositiveReactions);
yield (0, core_1.setOutput)("commentId", result.commentId);
yield (0, core_1.setOutput)("discussionId", response.discussion.node_id);
yield (0, core_1.setOutput)("clientMutationId", response.clientMutationId);
}
catch (err) {
yield (0, core_1.setFailed)(String(err));
}
try {
const response = yield markDiscussionAnswerCall(commentNodeId, token);
yield (0, core_1.setOutput)("discussionId", response.markDiscussionCommentAsAnswer.discussion.node_id);
yield (0, core_1.setOutput)("clientMutationId", response.markDiscussionCommentAsAnswer.clientMutationId);
}
catch (error) {
yield (0, core_1.setFailed)(error.message);
}
});
}
exports.markDiscussionCommentAnswer = markDiscussionCommentAnswer;
Expand Down
30 changes: 0 additions & 30 deletions src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,36 +31,6 @@ afterAll(async () => {
await jest.clearAllMocks();
});

// test("run function successfully runs", async () => {
// await mockedGetInput.mockReturnValueOnce("{{ secrets.GITHUB_TOKEN }}");
// await mockedGetInput.mockReturnValueOnce("3");
// await mockedGetInput.mockReturnValueOnce("3");

// const mockedResponse = {
// clientMutationId: "1234",
// discussion: {
// node_id: "DC_kwDOKczwv84Abmrk",
// },
// };
// const mockedResult = {
// commentId: "DC_kwDOKczwv84Abmrk",
// commentText: "hello",
// reactionThreshold: 3,
// totalReactions: 10,
// totalPositiveReactions: 5,
// };

// await mockedGraphQL.mockResolvedValueOnce(commentsReactions);
// await markDiscussionCommentAnswer();

// await expect(mockedGetInput).toHaveBeenCalledTimes(3);
// await expect(mockedGraphQL).toHaveBeenCalledTimes(2);
// await expect(mockedSetOutput).toHaveBeenCalledWith("commentText", "hello");
// await expect(mockedSetOutput).toHaveBeenCalledWith("reactionThreshold", 3);
// await expect(mockedSetOutput).toHaveBeenCalledWith("totalReactions", 6);
// await expect(mockedSetOutput).toHaveBeenCalledWith("commentId", "DC_kwDOKczwv84Abmrk");
// });

test("Run function successfully with mocked GraphQL responses", async () => {
await mockedGetInput.mockReturnValueOnce("3");
await mockedGetInput.mockReturnValueOnce("3");
Expand Down

0 comments on commit 7bae815

Please sign in to comment.