parseGithubUrl.test.ts 559 B

1234567891011121314151617181920
  1. import { expect, test } from "vitest";
  2. import { parseGithubUrl } from "../../src/utils/parseGithubUrl";
  3. test("parseGithubUrl", () => {
  4. expect(
  5. parseGithubUrl("https://github.com/alexreardon/tiny-invariant"),
  6. ).toEqual(["alexreardon", "tiny-invariant"]);
  7. expect(parseGithubUrl("https://github.com/All-Hands-AI/OpenHands")).toEqual([
  8. "All-Hands-AI",
  9. "OpenHands",
  10. ]);
  11. expect(parseGithubUrl("https://github.com/All-Hands-AI/")).toEqual([
  12. "All-Hands-AI",
  13. "",
  14. ]);
  15. expect(parseGithubUrl("https://github.com/")).toEqual([]);
  16. });