mirror of
https://github.com/markwylde/claude-code-gitea-action.git
synced 2026-08-01 11:12:59 +08:00
chore: format gitea branch
This commit is contained in:
@@ -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/)",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user