@@ -32,6 +32,15 @@ I hope it works`,
3232
3333// Destructuring for easier access later
3434let { owner, repo, base, branch } = validRequest ;
35+ const mockCommitList = {
36+ commits : [ { sha : "ef105a72c03ce2743d90944c2977b1b5563b43c0" } ]
37+ } ;
38+ const mockSecondCommitList = {
39+ commits : [ { sha : "45d77edc93556e3a997bf73d5ed4d9fb57068928" } ]
40+ } ;
41+ const mockSubmoduleCommitList = {
42+ commits : [ { sha : "ef105a72c03ce2743d90944c2977b1b5563b43c0" } ]
43+ } ;
3544
3645for ( let req of [ "owner" , "repo" , "branch" ] ) {
3746 const body = { ...validRequest } ;
@@ -163,7 +172,7 @@ test(`success (submodule, branch exists)`, async () => {
163172 mockCommitSubmodule ( `sha-${ branch } ` ) ;
164173 mockUpdateRef ( branch ) ;
165174
166- await expect ( run ( body ) ) . resolves . toEqual ( branch ) ;
175+ await expect ( run ( body ) ) . resolves . toEqual ( mockSubmoduleCommitList ) ;
167176} ) ;
168177
169178test ( `success (branch exists)` , async ( ) => {
@@ -177,7 +186,7 @@ test(`success (branch exists)`, async () => {
177186 mockCommit ( `sha-${ branch } ` ) ;
178187 mockUpdateRef ( branch ) ;
179188
180- await expect ( run ( body ) ) . resolves . toEqual ( branch ) ;
189+ await expect ( run ( body ) ) . resolves . toEqual ( mockCommitList ) ;
181190} ) ;
182191
183192test ( `success (committer details)` , async ( ) => {
@@ -198,7 +207,7 @@ test(`success (committer details)`, async () => {
198207 } ) ;
199208 mockUpdateRef ( branch ) ;
200209
201- await expect ( run ( body ) ) . resolves . toEqual ( branch ) ;
210+ await expect ( run ( body ) ) . resolves . toEqual ( mockCommitList ) ;
202211} ) ;
203212
204213test ( `success (author details)` , async ( ) => {
@@ -219,7 +228,7 @@ test(`success (author details)`, async () => {
219228 } ) ;
220229 mockUpdateRef ( branch ) ;
221230
222- await expect ( run ( body ) ) . resolves . toEqual ( branch ) ;
231+ await expect ( run ( body ) ) . resolves . toEqual ( mockCommitList ) ;
223232} ) ;
224233
225234test ( `success (createBranch, base provided)` , async ( ) => {
@@ -235,7 +244,7 @@ test(`success (createBranch, base provided)`, async () => {
235244 mockCommit ( `sha-${ base } ` ) ;
236245 mockCreateRef ( branch ) ;
237246
238- await expect ( run ( body ) ) . resolves . toEqual ( branch ) ;
247+ await expect ( run ( body ) ) . resolves . toEqual ( mockCommitList ) ;
239248} ) ;
240249
241250test ( `success (createBranch, use default base branch)` , async ( ) => {
@@ -256,7 +265,7 @@ test(`success (createBranch, use default base branch)`, async () => {
256265 mockCommit ( `sha-${ repoDefaultBranch } ` ) ;
257266 mockCreateRef ( branch ) ;
258267
259- await expect ( run ( body ) ) . resolves . toEqual ( branch ) ;
268+ await expect ( run ( body ) ) . resolves . toEqual ( mockCommitList ) ;
260269} ) ;
261270
262271test ( `success (createBranch, use default base branch, multiple commits)` , async ( ) => {
@@ -288,7 +297,9 @@ test(`success (createBranch, use default base branch, multiple commits)`, async
288297 mockCommitSecond ( `ef105a72c03ce2743d90944c2977b1b5563b43c0` ) ;
289298 mockCreateRef ( branch , `45d77edc93556e3a997bf73d5ed4d9fb57068928` ) ;
290299
291- await expect ( run ( body ) ) . resolves . toEqual ( branch ) ;
300+ await expect ( run ( body ) ) . resolves . toEqual ( {
301+ commits : [ ...mockCommitList . commits , ...mockSecondCommitList . commits ]
302+ } ) ;
292303} ) ;
293304
294305test ( "success (ignore missing deleted files)" , async ( ) => {
@@ -321,7 +332,7 @@ test("success (ignore missing deleted files)", async () => {
321332 changes
322333 } ;
323334
324- await expect ( run ( body ) ) . resolves . toEqual ( branch ) ;
335+ await expect ( run ( body ) ) . resolves . toEqual ( mockSecondCommitList ) ;
325336} ) ;
326337
327338test ( "success (fileToDelete exists)" , async ( ) => {
@@ -352,7 +363,7 @@ test("success (fileToDelete exists)", async () => {
352363 changes
353364 } ;
354365
355- await expect ( run ( body ) ) . resolves . toEqual ( branch ) ;
366+ await expect ( run ( body ) ) . resolves . toEqual ( mockSecondCommitList ) ;
356367} ) ;
357368
358369test ( "failure (fileToDelete is missing)" , async ( ) => {
0 commit comments