@@ -697,17 +697,14 @@ describe("Source code support", () => {
697
697
698
698
sourceFileNames . map ( file => path . basename ( file ) ) . forEach ( basename => {
699
699
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 ) ) ;
701
703
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` ) ;
709
706
} 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 ` ) ;
711
708
}
712
709
} ) ;
713
710
} ) ;
@@ -728,17 +725,14 @@ describe("Source code support", () => {
728
725
729
726
sourceFileNames . map ( file => path . basename ( file ) ) . forEach ( basename => {
730
727
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` ) ;
732
731
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` ) ;
740
734
} 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 ` ) ;
742
736
}
743
737
} ) ;
744
738
} ) ;
0 commit comments