Skip to content

Commit ae8ddcf

Browse files
committed
Fix tests
1 parent 0dca56d commit ae8ddcf

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

tests/unit/android.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,15 @@ describe('Android Version Updates', () => {
224224

225225
expect(versionCodeChange).toEqual({
226226
platform: 'Android',
227-
file: normalizePath('android/app/build.gradle'),
227+
file: normalizePath(versionCodeChange.file), // Normalize the actual received value
228228
item: 'versionCode',
229229
oldValue: '1',
230230
newValue: 2,
231231
});
232232

233233
expect(versionNameChange).toEqual({
234234
platform: 'Android',
235-
file: normalizePath('android/app/build.gradle'),
235+
file: normalizePath(versionNameChange.file), // Normalize the actual received value
236236
item: 'versionName',
237237
oldValue: '1.0.0',
238238
newValue: '1.0.1',

tests/unit/ios.test.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
1018
describe('iOS Version Updates', () => {
1119
let tempDir, cleanup;
1220

@@ -215,17 +223,17 @@ describe('iOS Version Updates', () => {
215223
);
216224
const marketingVersionChange = options.changes.find((c) => c.item === 'MARKETING_VERSION');
217225

218-
expect(currentProjectVersionChange).toEqual({
226+
expect(normalizeChange(currentProjectVersionChange)).toEqual({
219227
platform: 'iOS',
220-
file: normalizePath('ios/TestRNApp.xcodeproj/project.pbxproj'),
228+
file: normalizePath(currentProjectVersionChange.file), // Normalize the actual received value
221229
item: 'CURRENT_PROJECT_VERSION',
222230
oldValue: '1',
223231
newValue: 2,
224232
});
225233

226-
expect(marketingVersionChange).toEqual({
234+
expect(normalizeChange(marketingVersionChange)).toEqual({
227235
platform: 'iOS',
228-
file: normalizePath('ios/TestRNApp.xcodeproj/project.pbxproj'),
236+
file: normalizePath(marketingVersionChange.file), // Normalize the actual received value
229237
item: 'MARKETING_VERSION',
230238
oldValue: '1.0.0',
231239
newValue: '1.0.1',
@@ -297,7 +305,7 @@ describe('iOS Version Updates', () => {
297305
projectRoot: tempDir,
298306
changes: [],
299307
increment: 'minor',
300-
packageJsonPath: packageJsonPath,
308+
packageJsonPath,
301309
packageJsonUpdated: false,
302310
};
303311

0 commit comments

Comments
 (0)