File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,16 @@ import {
3434
3535const 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
Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments