@@ -180,6 +180,48 @@ test(`success (branch exists)`, async () => {
180180 await expect ( run ( body ) ) . resolves . toEqual ( branch ) ;
181181} ) ;
182182
183+ test ( `success (committer details)` , async ( ) => {
184+ const committer = {
185+ name : "Ashley Person" ,
186+ email : "a.person@example.com"
187+ } ;
188+ const body = {
189+ ...validRequest ,
190+ committer
191+ } ;
192+ mockGetRef ( branch , `sha-${ branch } ` , true ) ;
193+ mockCreateBlobFileOne ( ) ;
194+ mockCreateBlobFileTwo ( ) ;
195+ mockCreateTree ( `sha-${ branch } ` ) ;
196+ mockCommit ( `sha-${ branch } ` , {
197+ committer
198+ } ) ;
199+ mockUpdateRef ( branch ) ;
200+
201+ await expect ( run ( body ) ) . resolves . toEqual ( branch ) ;
202+ } ) ;
203+
204+ test ( `success (author details)` , async ( ) => {
205+ const author = {
206+ name : "Ashley Person" ,
207+ email : "a.person@example.com"
208+ } ;
209+ const body = {
210+ ...validRequest ,
211+ author
212+ } ;
213+ mockGetRef ( branch , `sha-${ branch } ` , true ) ;
214+ mockCreateBlobFileOne ( ) ;
215+ mockCreateBlobFileTwo ( ) ;
216+ mockCreateTree ( `sha-${ branch } ` ) ;
217+ mockCommit ( `sha-${ branch } ` , {
218+ author
219+ } ) ;
220+ mockUpdateRef ( branch ) ;
221+
222+ await expect ( run ( body ) ) . resolves . toEqual ( branch ) ;
223+ } ) ;
224+
183225test ( `success (createBranch, base provided)` , async ( ) => {
184226 const body = {
185227 ...validRequest ,
@@ -561,11 +603,14 @@ function mockCommitSubmodule(baseTree) {
561603 m . reply ( 200 , body ) ;
562604}
563605
564- function mockCommit ( baseTree ) {
606+ function mockCommit ( baseTree , additional ) {
607+ additional = additional || { } ;
608+
565609 const expectedBody = {
566610 message : "Your commit message" ,
567611 tree : "4112258c05f8ce2b0570f1bbb1a330c0f9595ff9" ,
568- parents : [ baseTree ]
612+ parents : [ baseTree ] ,
613+ ...additional
569614 } ;
570615
571616 const m = nock ( "https://api.github.com" ) . post (
0 commit comments