Skip to content
Source
Sign inSign up
Open History to see the last commit

sourceControl.test.ts

25 lines690 Bytes

1import { describe, expect, it } from "vite-plus/test";
2​
3import { isSshRemoteUrl } from "./sourceControl.ts";
4​
5describe("isSshRemoteUrl", () => {
6 it.each([
7 "git@github.com:owner/repo.git",
8 "ssh://git@github.com/owner/repo.git",
9 "github.com:owner/repo.git",
10 "github-work:owner/repo.git",
11 ])("reads %s as SSH", (remoteUrl) => {
12 expect(isSshRemoteUrl(remoteUrl)).toBe(true);
13 });
14​
15 it.each([
16 "https://github.com/owner/repo.git",
17 "C:/repos/repo",
18 "/srv/git/repo.git",
19 "./team:group/repo",
20 "file:///srv/git/repo.git",
21 "hg::owner/repo",
22 ])("does not read %s as SSH", (remoteUrl) => {
23 expect(isSshRemoteUrl(remoteUrl)).toBe(false);
24 });
25});