@lizard-build/cli 4.0.63 → 4.0.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,10 +8,15 @@ afterEach(() => {
8
8
 
9
9
  describe("lizard git helpers", () => {
10
10
  it("reads owner/name from Lizard Git remotes only", () => {
11
- expect(repoFromRemote("https://git.lizard.build/alice/app.git")).toBe("alice/app");
11
+ expect(repoFromRemote("https://lizard.build/git/alice/app.git")).toBe("alice/app");
12
+ expect(repoFromRemote("https://lizard:liz_x@lizard.build/git/alice/app")).toBe("alice/app");
13
+ expect(repoFromRemote("https://git.lizard.build/alice/app.git")).toBe("alice/app"); // older clones
12
14
  expect(repoFromRemote("https://lizard:liz_x@git.lizard.build/alice/app")).toBe("alice/app");
13
15
  expect(repoFromRemote("https://github.com/alice/app.git")).toBeNull();
14
16
  expect(repoFromRemote("git@github.com:alice/app.git")).toBeNull();
17
+ expect(repoFromRemote("https://lizard.build/alice/app.git")).toBeNull();
18
+ expect(repoFromRemote("https://lizard.build/gitx/alice/app.git")).toBeNull();
19
+ expect(repoFromRemote("https://lizard.build/git/alice/app/extra.git")).toBeNull();
15
20
  });
16
21
 
17
22
  it("drops empty query values", () => {
@@ -21,7 +26,8 @@ describe("lizard git helpers", () => {
21
26
  it("honours LIZARD_GIT_URL", () => {
22
27
  vi.stubEnv("LIZARD_GIT_URL", "http://localhost:8080/");
23
28
  expect(gitURL()).toBe("http://localhost:8080");
24
- expect(repoFromRemote("http://localhost:8080/a/b.git", gitURL())).toBe("a/b");
29
+ expect(repoFromRemote("http://localhost:8080/a/b.git")).toBe("a/b");
30
+ expect(repoFromRemote("https://git.lizard.build/a/b.git")).toBeNull(); // another server: only it
25
31
  });
26
32
 
27
33
  it("runs itself as git's credential helper", () => {
@@ -37,7 +43,7 @@ describe("lizard git helpers", () => {
37
43
  }));
38
44
  expect(await resolveRepo("alice/app")).toBe("alice/app");
39
45
  expect(await resolveRepo("app")).toBe("me/app");
40
- expect(calls).toEqual(["GET https://git.lizard.build/api/session Bearer liz_test"]);
46
+ expect(calls).toEqual(["GET https://lizard.build/git/api/session Bearer liz_test"]);
41
47
  await expect(resolveRepo("a/b/c")).rejects.toThrow(/owner\/name/);
42
48
  });
43
49
 
@@ -61,5 +67,7 @@ describe("lizard git safety", () => {
61
67
  expect(() => segs("../../api/user/tokens")).toThrow(/bad path/);
62
68
  expect(segs("src/a b.js")).toBe("src/a%20b.js");
63
69
  expect(repoFromRemote("https://git.lizard.build/../x.git")).toBeNull();
70
+ expect(repoFromRemote("https://lizard.build/git/../x.git")).toBeNull();
71
+ expect(repoFromRemote("https://lizard.build/git/a/...git")).toBeNull();
64
72
  });
65
73
  });