-
Notifications
You must be signed in to change notification settings - Fork 1
/
version_test.ts
24 lines (21 loc) · 963 Bytes
/
version_test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import * as ta from "https://deno.land/[email protected]/testing/asserts.ts";
import * as mod from "./version.ts";
Deno.test("remote version without repoIdentity detector", async () => {
const version = await mod.determineVersionFromRepoTag(
"https://raw.githubusercontent.com/gov-suite/governed-text-template/v0.4.13/toctl.ts",
);
ta.assertEquals(version, "v0.4.13");
});
Deno.test("remote version with repoIdentity detector", async () => {
const version = await mod.determineVersionFromRepoTag(
"https://raw.githubusercontent.com/gov-suite/governed-text-template/v0.4.13/toctl.ts",
{ repoIdentity: "gov-suite/governed-text-template" },
);
ta.assertEquals(version, "v0.4.13");
});
Deno.test("local version detector", async () => {
const version = await mod.determineVersionFromRepoTag(
"file:///home/snshah/workspaces/github.com/gov-suite/governed-text-template/toctl.ts",
);
ta.assertStringIncludes(version, "v0.0.0-remote");
});