mirror of
https://github.com/marocchino/sticky-pull-request-comment.git
synced 2026-04-20 04:55:43 +00:00
Migrate to biome
This commit is contained in:
parent
e24be28b0d
commit
cce8920b20
15 changed files with 433 additions and 2243 deletions
|
|
@ -90,12 +90,8 @@ it("findPreviousComment", async () => {
|
|||
} as any)
|
||||
|
||||
expect(await findPreviousComment(octokit, repo, 123, "")).toBe(comment)
|
||||
expect(await findPreviousComment(octokit, repo, 123, "TypeA")).toBe(
|
||||
commentWithCustomHeader
|
||||
)
|
||||
expect(await findPreviousComment(octokit, repo, 123, "LegacyComment")).toBe(
|
||||
headerFirstComment
|
||||
)
|
||||
expect(await findPreviousComment(octokit, repo, 123, "TypeA")).toBe(commentWithCustomHeader)
|
||||
expect(await findPreviousComment(octokit, repo, 123, "LegacyComment")).toBe(headerFirstComment)
|
||||
expect(octokit.graphql).toBeCalledWith(expect.any(String), {
|
||||
after: null,
|
||||
number: 123,
|
||||
|
|
@ -112,18 +108,14 @@ describe("updateComment", () => {
|
|||
})
|
||||
|
||||
it("with comment body", async () => {
|
||||
expect(
|
||||
await updateComment(octokit, "456", "hello there", "")
|
||||
).toBeUndefined()
|
||||
expect(await updateComment(octokit, "456", "hello there", "")).toBeUndefined()
|
||||
expect(octokit.graphql).toBeCalledWith(expect.any(String), {
|
||||
input: {
|
||||
id: "456",
|
||||
body: "hello there\n<!-- Sticky Pull Request Comment -->"
|
||||
}
|
||||
})
|
||||
expect(
|
||||
await updateComment(octokit, "456", "hello there", "TypeA")
|
||||
).toBeUndefined()
|
||||
expect(await updateComment(octokit, "456", "hello there", "TypeA")).toBeUndefined()
|
||||
expect(octokit.graphql).toBeCalledWith(expect.any(String), {
|
||||
input: {
|
||||
id: "456",
|
||||
|
|
@ -164,18 +156,16 @@ describe("createComment", () => {
|
|||
})
|
||||
|
||||
it("with comment body or previousBody", async () => {
|
||||
expect(await createComment(octokit, repo, 456, "hello there", "")).toEqual(
|
||||
"<return value>"
|
||||
)
|
||||
expect(await createComment(octokit, repo, 456, "hello there", "")).toEqual("<return value>")
|
||||
expect(octokit.rest.issues.createComment).toBeCalledWith({
|
||||
issue_number: 456,
|
||||
owner: "marocchino",
|
||||
repo: "sticky-pull-request-comment",
|
||||
body: "hello there\n<!-- Sticky Pull Request Comment -->"
|
||||
})
|
||||
expect(
|
||||
await createComment(octokit, repo, 456, "hello there", "TypeA")
|
||||
).toEqual("<return value>")
|
||||
expect(await createComment(octokit, repo, 456, "hello there", "TypeA")).toEqual(
|
||||
"<return value>"
|
||||
)
|
||||
expect(octokit.rest.issues.createComment).toBeCalledWith({
|
||||
issue_number: 456,
|
||||
owner: "marocchino",
|
||||
|
|
|
|||
|
|
@ -250,9 +250,7 @@ describe("path", () => {
|
|||
ignoreEmpty: false,
|
||||
skipUnchanged: false
|
||||
})
|
||||
expect(await require("../src/config").getBody()).toEqual(
|
||||
"hi there\n\nhey there\n"
|
||||
)
|
||||
expect(await require("../src/config").getBody()).toEqual("hi there\n\nhey there\n")
|
||||
})
|
||||
|
||||
test("when not exists return null string", async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue