OpenHands/frontend/__tests__/utils/parse-github-url.test.ts

21 lines
561 B
TypeScript

import { expect, test } from "vitest";
import { parseGithubUrl } from "../../src/utils/parse-github-url";
test("parseGithubUrl", () => {
expect(
parseGithubUrl("https://github.com/alexreardon/tiny-invariant"),
).toEqual(["alexreardon", "tiny-invariant"]);
expect(parseGithubUrl("https://github.com/All-Hands-AI/OpenHands")).toEqual([
"All-Hands-AI",
"OpenHands",
]);
expect(parseGithubUrl("https://github.com/All-Hands-AI/")).toEqual([
"All-Hands-AI",
"",
]);
expect(parseGithubUrl("https://github.com/")).toEqual([]);
});