Skip to content

Commit a269b8e

Browse files
committed
Test graphql too
1 parent e679dc7 commit a269b8e

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

src/test/integration/node.test.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,42 @@ describe("node", () => {
314314
expect(branchRef.data.object.sha).toEqual(commit.data.sha);
315315
});
316316

317+
it("can create a commit using the GraphQL commit path", async () => {
318+
const branch = `${TEST_BRANCH_PREFIX}-graphql-git-${Date.now()}`;
319+
const filePath = "graphql-git-api-test.txt";
320+
321+
await commitFilesFromBuffers({
322+
octokit,
323+
...REPO,
324+
branch,
325+
base: {
326+
branch: "main",
327+
},
328+
message: {
329+
headline: "Test GraphQL git commit",
330+
body: "Created through commitFilesFromBuffers",
331+
},
332+
fileChanges: {
333+
additions: [
334+
{
335+
path: filePath,
336+
contents: Buffer.from("Hello from the GraphQL commit path!\n"),
337+
},
338+
],
339+
},
340+
log,
341+
});
342+
343+
await waitForGitHubToBeReady();
344+
345+
const branchRef = await octokit.rest.git.getRef({
346+
...REPO,
347+
ref: `heads/${branch}`,
348+
});
349+
350+
expect(branchRef.data.object.sha).toBeTruthy();
351+
});
352+
317353
describe("existing branches", () => {
318354
it("can commit to existing branch when force is true", async () => {
319355
const branch = `${TEST_BRANCH_PREFIX}-existing-branch-force`;

0 commit comments

Comments
 (0)