@@ -27,7 +27,7 @@ describe('Testing the Validate function', () => {
2727describe ( 'Testing the getBranchFromAlias function' , ( ) => {
2828 describe ( 'When branch alias exists and resolves successfully' , ( ) => {
2929 it ( 'should return the branch UID' , async ( ) => {
30- const mockStack = {
30+ const mockStack : any = {
3131 branchAlias : ( alias : string ) => ( {
3232 fetch : async ( ) => ( { uid : 'main-branch' } )
3333 } )
@@ -60,7 +60,7 @@ describe('Testing the getBranchFromAlias function', () => {
6060 } ) ;
6161
6262 it ( 'should throw error for null branchAlias' , async ( ) => {
63- const mockStack = {
63+ const mockStack : any = {
6464 branchAlias : ( alias : string ) => ( {
6565 fetch : async ( ) => ( { uid : 'main-branch' } )
6666 } )
@@ -76,7 +76,7 @@ describe('Testing the getBranchFromAlias function', () => {
7676 } ) ;
7777
7878 it ( 'should throw error for undefined branchAlias' , async ( ) => {
79- const mockStack = {
79+ const mockStack : any = {
8080 branchAlias : ( alias : string ) => ( {
8181 fetch : async ( ) => ( { uid : 'main-branch' } )
8282 } )
@@ -92,14 +92,14 @@ describe('Testing the getBranchFromAlias function', () => {
9292 } ) ;
9393
9494 it ( 'should throw error for non-string branchAlias' , async ( ) => {
95- const mockStack = {
95+ const mockStack : any = {
9696 branchAlias : ( alias : string ) => ( {
9797 fetch : async ( ) => ( { uid : 'main-branch' } )
9898 } )
9999 } ;
100100
101101 try {
102- await getBranchFromAlias ( mockStack , 123 ) ;
102+ await getBranchFromAlias ( mockStack , 123 as any ) ;
103103 expect . fail ( 'Expected function to throw an error' ) ;
104104 } catch ( error ) {
105105 expect ( error ) . to . be . instanceOf ( Error ) ;
@@ -108,7 +108,7 @@ describe('Testing the getBranchFromAlias function', () => {
108108 } ) ;
109109
110110 it ( 'should throw error for empty string branchAlias' , async ( ) => {
111- const mockStack = {
111+ const mockStack : any = {
112112 branchAlias : ( alias : string ) => ( {
113113 fetch : async ( ) => ( { uid : 'main-branch' } )
114114 } )
@@ -126,7 +126,7 @@ describe('Testing the getBranchFromAlias function', () => {
126126
127127 describe ( 'When branch alias does not exist' , ( ) => {
128128 it ( 'should throw an error' , async ( ) => {
129- const mockStack = {
129+ const mockStack : any = {
130130 branchAlias : ( alias : string ) => ( {
131131 fetch : async ( ) => {
132132 throw new Error ( 'Branch alias not found' ) ;
@@ -146,7 +146,7 @@ describe('Testing the getBranchFromAlias function', () => {
146146
147147 describe ( 'When response is missing UID' , ( ) => {
148148 it ( 'should throw error for response without uid' , async ( ) => {
149- const mockStack = {
149+ const mockStack : any = {
150150 branchAlias : ( alias : string ) => ( {
151151 fetch : async ( ) => ( { name : 'main-branch' } ) // missing uid
152152 } )
@@ -162,7 +162,7 @@ describe('Testing the getBranchFromAlias function', () => {
162162 } ) ;
163163
164164 it ( 'should throw error for response with null uid' , async ( ) => {
165- const mockStack = {
165+ const mockStack : any = {
166166 branchAlias : ( alias : string ) => ( {
167167 fetch : async ( ) => ( { uid : null } )
168168 } )
@@ -178,7 +178,7 @@ describe('Testing the getBranchFromAlias function', () => {
178178 } ) ;
179179
180180 it ( 'should throw error for response with undefined uid' , async ( ) => {
181- const mockStack = {
181+ const mockStack : any = {
182182 branchAlias : ( alias : string ) => ( {
183183 fetch : async ( ) => ( { uid : undefined } )
184184 } )
@@ -194,7 +194,7 @@ describe('Testing the getBranchFromAlias function', () => {
194194 } ) ;
195195
196196 it ( 'should throw error for response with empty string uid' , async ( ) => {
197- const mockStack = {
197+ const mockStack : any = {
198198 branchAlias : ( alias : string ) => ( {
199199 fetch : async ( ) => ( { uid : '' } )
200200 } )
@@ -210,7 +210,7 @@ describe('Testing the getBranchFromAlias function', () => {
210210 } ) ;
211211
212212 it ( 'should throw error for empty response object' , async ( ) => {
213- const mockStack = {
213+ const mockStack : any = {
214214 branchAlias : ( alias : string ) => ( {
215215 fetch : async ( ) => ( { } )
216216 } )
@@ -229,7 +229,7 @@ describe('Testing the getBranchFromAlias function', () => {
229229 describe ( 'When network error occurs' , ( ) => {
230230 it ( 'should throw the network error' , async ( ) => {
231231 const networkError = new Error ( 'Network timeout' ) ;
232- const mockStack = {
232+ const mockStack : any = {
233233 branchAlias : ( alias : string ) => ( {
234234 fetch : async ( ) => {
235235 throw networkError ;
0 commit comments