Update tests

This commit is contained in:
Alex Burgel 2023-05-04 22:54:38 -04:00
parent dadbe89de1
commit 316d491c26

View file

@ -159,13 +159,13 @@ describe("createComment", () => {
beforeEach(() => { beforeEach(() => {
jest jest
.spyOn<any, string>(octokit.rest.issues, "createComment") .spyOn<any, string>(octokit.rest.issues, "createComment")
.mockResolvedValue("") .mockResolvedValue("<return value>")
}) })
it("with comment body or previousBody", async () => { it("with comment body or previousBody", async () => {
expect( expect(await createComment(octokit, repo, 456, "hello there", "")).toEqual(
await createComment(octokit, repo, 456, "hello there", "") "<return value>"
).toBeUndefined() )
expect(octokit.rest.issues.createComment).toBeCalledWith({ expect(octokit.rest.issues.createComment).toBeCalledWith({
issue_number: 456, issue_number: 456,
owner: "marocchino", owner: "marocchino",
@ -174,7 +174,7 @@ describe("createComment", () => {
}) })
expect( expect(
await createComment(octokit, repo, 456, "hello there", "TypeA") await createComment(octokit, repo, 456, "hello there", "TypeA")
).toBeUndefined() ).toEqual("<return value>")
expect(octokit.rest.issues.createComment).toBeCalledWith({ expect(octokit.rest.issues.createComment).toBeCalledWith({
issue_number: 456, issue_number: 456,
owner: "marocchino", owner: "marocchino",