Skip to content

Commit 93bb6b1

Browse files
committed
try to open PRs
1 parent a269b8e commit 93bb6b1

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

src/test/integration/node.test.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,21 @@ describe("node", () => {
9393
}
9494
};
9595

96+
const createPullRequestForBranch = async (branch: string, title: string) => {
97+
const pullRequest = await octokit.rest.pulls.create({
98+
...REPO,
99+
title,
100+
head: branch,
101+
base: "main",
102+
body: `CI-created integration test PR for \`${branch}\`.`,
103+
});
104+
105+
expect(pullRequest.data.state).toEqual("open");
106+
expect(pullRequest.data.head.ref).toEqual(branch);
107+
108+
return pullRequest.data.html_url;
109+
};
110+
96111
let testTargetCommit: string;
97112
/**
98113
* For tests, important that this commit is not an ancestor of TEST_TARGET_COMMIT,
@@ -312,6 +327,13 @@ describe("node", () => {
312327
});
313328

314329
expect(branchRef.data.object.sha).toEqual(commit.data.sha);
330+
331+
const pullRequestUrl = await createPullRequestForBranch(
332+
branch,
333+
`test: REST git API branch ${branch}`,
334+
);
335+
336+
expect(pullRequestUrl).toContain(`/pull/`);
315337
});
316338

317339
it("can create a commit using the GraphQL commit path", async () => {
@@ -348,6 +370,13 @@ describe("node", () => {
348370
});
349371

350372
expect(branchRef.data.object.sha).toBeTruthy();
373+
374+
const pullRequestUrl = await createPullRequestForBranch(
375+
branch,
376+
`test: GraphQL commit path branch ${branch}`,
377+
);
378+
379+
expect(pullRequestUrl).toContain(`/pull/`);
351380
});
352381

353382
describe("existing branches", () => {

0 commit comments

Comments
 (0)