@@ -697,17 +697,14 @@ describe("Source code support", () => {
697697
698698 sourceFileNames . map ( file => path . basename ( file ) ) . forEach ( basename => {
699699 const ext = path . extname ( basename ) ;
700- const shouldBeAdded = ext !== ".donotadd" ;
700+ const shouldBeAdded = ext !== ".donotadd" && ! ext . startsWith ( ".h" ) ;
701+ assert . notEqual ( pbxFileReferenceValues . indexOf ( basename ) , - 1 , `${ basename } not added to PBXFileRefereces` ) ;
702+ const buildPhaseFile = buildPhaseFiles . find ( ( fileObject : any ) => fileObject . comment . startsWith ( basename ) ) ;
701703 if ( shouldBeAdded ) {
702- assert . notEqual ( pbxFileReferenceValues . indexOf ( basename ) , - 1 , `${ basename } not added to PBXFileRefereces` ) ;
703-
704- if ( shouldBeAdded && ! path . extname ( basename ) . startsWith ( ".h" ) ) {
705- const buildPhaseFile = buildPhaseFiles . find ( ( fileObject : any ) => fileObject . comment . startsWith ( basename ) ) ;
706- assert . isDefined ( buildPhaseFile , `${ basename } not added to PBXSourcesBuildPhase` ) ;
707- assert . include ( buildPhaseFile . comment , "in Sources" , `${ basename } must be added to Sources group` ) ;
708- }
704+ assert . isDefined ( buildPhaseFile , `${ basename } not added to PBXSourcesBuildPhase` ) ;
705+ assert . include ( buildPhaseFile . comment , "in Sources" , `${ basename } must be added to Sources group` ) ;
709706 } else {
710- assert . equal ( pbxFileReferenceValues . indexOf ( basename ) , - 1 , `${ basename } was added to PBXFileRefereces, but it shouldn't have been ` ) ;
707+ assert . isUndefined ( buildPhaseFile , `${ basename } must not be added to Sources group ` ) ;
711708 }
712709 } ) ;
713710 } ) ;
@@ -728,17 +725,14 @@ describe("Source code support", () => {
728725
729726 sourceFileNames . map ( file => path . basename ( file ) ) . forEach ( basename => {
730727 const ext = path . extname ( basename ) ;
731- const shouldBeAdded = ext !== ".donotadd" ;
728+ const shouldBeAdded = ext !== ".donotadd" && ! ext . startsWith ( ".h" ) ;
729+ const buildPhaseFile = buildPhaseFiles . find ( ( fileObject : any ) => fileObject . comment . startsWith ( basename ) ) ;
730+ assert . notEqual ( pbxFileReferenceValues . indexOf ( basename ) , - 1 , `${ basename } not added to PBXFileRefereces` ) ;
732731 if ( shouldBeAdded ) {
733- assert . notEqual ( pbxFileReferenceValues . indexOf ( basename ) , - 1 , `${ basename } not added to PBXFileRefereces` ) ;
734-
735- if ( shouldBeAdded && ! path . extname ( basename ) . startsWith ( ".h" ) ) {
736- const buildPhaseFile = buildPhaseFiles . find ( ( fileObject : any ) => fileObject . comment . startsWith ( basename ) ) ;
737- assert . isDefined ( buildPhaseFile , `${ basename } not added to PBXSourcesBuildPhase` ) ;
738- assert . include ( buildPhaseFile . comment , "in Sources" , `${ basename } must be added to Sources group` ) ;
739- }
732+ assert . isDefined ( buildPhaseFile , `${ basename } not added to PBXSourcesBuildPhase` ) ;
733+ assert . include ( buildPhaseFile . comment , "in Sources" , `${ basename } must be added to Sources group` ) ;
740734 } else {
741- assert . equal ( pbxFileReferenceValues . indexOf ( basename ) , - 1 , `${ basename } was added to PBXFileRefereces, but it shouldn't have been ` ) ;
735+ assert . isUndefined ( buildPhaseFile , `${ basename } must not be added to Sources group ` ) ;
742736 }
743737 } ) ;
744738 } ) ;
0 commit comments