File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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` ;
You can’t perform that action at this time.
0 commit comments