feat(pr): add GitLab support
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { test, expect, describe } from "bun:test";
|
||||
import { detectPlatformFromHostname } from "../src/pr";
|
||||
|
||||
describe("pr platform detection", () => {
|
||||
test("detects supported hosted platforms", () => {
|
||||
expect(detectPlatformFromHostname("github.com")).toBe("github");
|
||||
expect(detectPlatformFromHostname("gitlab.com")).toBe("gitlab");
|
||||
});
|
||||
|
||||
test("detects self-hosted platform hostnames", () => {
|
||||
expect(detectPlatformFromHostname("gitlab.example.com")).toBe("gitlab");
|
||||
expect(detectPlatformFromHostname("gitea.example.com")).toBe("gitea");
|
||||
});
|
||||
|
||||
test("returns null for unknown hostnames", () => {
|
||||
expect(detectPlatformFromHostname("git.example.com")).toBeNull();
|
||||
expect(detectPlatformFromHostname(null)).toBeNull();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user