Skip to content

Commit 515ace9

Browse files
committed
fixup! test: add tests for the JS-based Xcode project generator
1 parent 3415610 commit 515ace9

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

ios/app.mjs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ import {
3434

3535
const SUPPORTED_PLATFORMS = ["ios", "macos", "visionos"];
3636

37+
/**
38+
* @param {string} platform
39+
* @returns {asserts platform is ApplePlatform}
40+
*/
41+
function assertSupportedPlatform(platform) {
42+
if (!SUPPORTED_PLATFORMS.includes(platform)) {
43+
throw new Error(`Unsupported platform: ${platform}`);
44+
}
45+
}
46+
3747
/**
3848
* @param {string} projectRoot
3949
* @param {string} destination
@@ -99,7 +109,7 @@ function readPackageVersion(p, fs = nodefs) {
99109

100110
/**
101111
* @param {string} projectRoot
102-
* @param {ApplePlatform} targetPlatform
112+
* @param {string} targetPlatform
103113
* @param {JSONObject} options
104114
* @returns {ProjectConfiguration}
105115
*/
@@ -109,9 +119,7 @@ export function generateProject(
109119
options,
110120
fs = nodefs
111121
) {
112-
if (!SUPPORTED_PLATFORMS.includes(targetPlatform)) {
113-
throw new Error(`Unsupported platform: ${targetPlatform}`);
114-
}
122+
assertSupportedPlatform(targetPlatform);
115123

116124
const appConfig = loadAppConfig(projectRoot, fs);
117125

test/ios/xcode.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ describe("overrideBuildSettings()", () => {
464464
});
465465
});
466466

467-
describe("macos/ReactTestApp.xcodeproj", () => {
467+
describe("macos/ReactTestApp.xcodeproj", macosOnly, () => {
468468
// Xcode expects the development team used for code signing to exist when
469469
// targeting macOS. Unlike when targeting iOS, the warnings are treated as
470470
// errors.

0 commit comments

Comments
 (0)