chore: format gitea branch

This commit is contained in:
Mark Wylde
2026-07-26 21:26:22 +01:00
parent c30a6c8c23
commit 40b8061da5
11 changed files with 455 additions and 442 deletions

View File

@@ -8,7 +8,7 @@ describe("GITEA_SERVER_URL configuration", () => {
process.env = { ...originalEnv };
delete process.env.GITEA_SERVER_URL;
delete process.env.GITHUB_SERVER_URL;
// Clear module cache to force re-evaluation
delete require.cache[require.resolve("../src/github/api/config")];
});
@@ -61,23 +61,35 @@ describe("GITEA_SERVER_URL configuration", () => {
it("should create correct job run links with custom GITEA_SERVER_URL", async () => {
process.env.GITEA_SERVER_URL = "https://gitea.example.com";
// Clear module cache and re-import
delete require.cache[require.resolve("../src/github/operations/comments/common")];
const { createJobRunLink } = await import("../src/github/operations/comments/common");
delete require.cache[
require.resolve("../src/github/operations/comments/common")
];
const { createJobRunLink } = await import(
"../src/github/operations/comments/common"
);
const link = createJobRunLink("owner", "repo", "123");
expect(link).toBe("[View job run](https://gitea.example.com/owner/repo/actions/runs/123)");
expect(link).toBe(
"[View job run](https://gitea.example.com/owner/repo/actions/runs/123)",
);
});
it("should create correct branch links with custom GITEA_SERVER_URL", async () => {
process.env.GITEA_SERVER_URL = "https://gitea.example.com";
// Clear module cache and re-import
delete require.cache[require.resolve("../src/github/operations/comments/common")];
const { createBranchLink } = await import("../src/github/operations/comments/common");
delete require.cache[
require.resolve("../src/github/operations/comments/common")
];
const { createBranchLink } = await import(
"../src/github/operations/comments/common"
);
const link = createBranchLink("owner", "repo", "feature-branch");
expect(link).toBe("\n[View branch](https://gitea.example.com/owner/repo/src/branch/feature-branch/)");
expect(link).toBe(
"\n[View branch](https://gitea.example.com/owner/repo/src/branch/feature-branch/)",
);
});
});