generated from hasundue/template-deno
-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
mod_test.ts
40 lines (33 loc) · 953 Bytes
/
mod_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
import {
assert,
assertEquals,
} from "https://deno.land/std@0.159.0/testing/asserts.ts";
import { createPullRequest } from "../mod.ts";
import { env } from "../lib/env.ts";
import { Client } from "../lib/github.ts";
const repo = "hasundue/denopendabot";
const base = "test";
const initial = "0.6.2"; // @denopendabot hasundue/denopendabot
const target = "1.0.0";
const github = new Client(env.GITHUB_TOKEN);
Deno.test({
name: "createPullRequest",
ignore: !env.CI,
fn: async () => {
const branch = "test-" + Date.now().valueOf();
await github.createBranch(repo, base);
const result = await createPullRequest(repo, {
base,
branch,
release: target,
include: ["mod.ts"],
isTest: true,
});
assert(result);
assertEquals(
result.title,
`[TEST] build(deps): bump hasundue/denopendabot from ${initial} to ${target}`,
);
await github.deleteBranch(repo, branch);
},
});