-
Notifications
You must be signed in to change notification settings - Fork 0
/
git_test.ts
41 lines (36 loc) · 1.06 KB
/
git_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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// =============================================================================
// File : git_test.ts
// Author : yukimemi
// Last Change : 2024/06/30 12:59:58.
// =============================================================================
import { assertEquals } from "jsr:@std/assert@1.0.2";
import { Git } from "./git.ts";
async function init() {
const repo = "https://github.com/yukimemi/dvpm";
const dst = await Deno.makeTempDir();
await Git.clone(repo, dst);
const git = new Git(dst);
return git;
}
Deno.test({
name: "Test getRevision",
sanitizeOps: false,
sanitizeResources: false,
fn: async () => {
const git = await init();
const expected = await git.getRevisionGit();
const actual = await git.getRevision();
assertEquals(actual, expected);
},
});
Deno.test({
name: "Test getBranch",
sanitizeOps: false,
sanitizeResources: false,
fn: async () => {
const git = await init();
const expected = await git.getBranchGit();
const actual = await git.getBranch();
assertEquals(actual, expected);
},
});