@@ -7,6 +7,14 @@ function normalizePath(filePath) {
77 return filePath . replace ( / \\ / g, '/' ) ;
88}
99
10+ // Add this helper function
11+ function normalizeChange ( change ) {
12+ return {
13+ ...change ,
14+ file : normalizePath ( change . file ) ,
15+ } ;
16+ }
17+
1018describe ( 'Android Version Updates' , ( ) => {
1119 let tempDir , cleanup ;
1220
@@ -222,17 +230,17 @@ describe('Android Version Updates', () => {
222230 const versionCodeChange = options . changes . find ( ( c ) => c . item === 'versionCode' ) ;
223231 const versionNameChange = options . changes . find ( ( c ) => c . item === 'versionName' ) ;
224232
225- expect ( versionCodeChange ) . toEqual ( {
233+ expect ( normalizeChange ( versionCodeChange ) ) . toEqual ( {
226234 platform : 'Android' ,
227- file : normalizePath ( versionCodeChange . file ) , // Normalize the actual received value
235+ file : 'android/app/build.gradle' ,
228236 item : 'versionCode' ,
229237 oldValue : '1' ,
230238 newValue : 2 ,
231239 } ) ;
232240
233- expect ( versionNameChange ) . toEqual ( {
241+ expect ( normalizeChange ( versionNameChange ) ) . toEqual ( {
234242 platform : 'Android' ,
235- file : normalizePath ( versionNameChange . file ) , // Normalize the actual received value
243+ file : 'android/app/build.gradle' ,
236244 item : 'versionName' ,
237245 oldValue : '1.0.0' ,
238246 newValue : '1.0.1' ,
@@ -304,7 +312,7 @@ describe('Android Version Updates', () => {
304312 projectRoot : tempDir ,
305313 changes : [ ] ,
306314 increment : 'minor' ,
307- packageJsonPath : packageJsonPath ,
315+ packageJsonPath,
308316 packageJsonUpdated : false ,
309317 } ;
310318
@@ -334,7 +342,7 @@ describe('Android Version Updates', () => {
334342 projectRoot : tempDir ,
335343 changes : [ ] ,
336344 increment : 'minor' ,
337- packageJsonPath : packageJsonPath ,
345+ packageJsonPath,
338346 packageJsonUpdated : true , // already updated
339347 } ;
340348
0 commit comments