@@ -548,7 +548,9 @@ describe("Source code in plugin support", () => {
548
548
assert . notEqual ( pbxFileReferenceValues . indexOf ( basename ) , - 1 , `${ basename } not added to PBXFileRefereces` ) ;
549
549
550
550
if ( shouldBeAdded && ! path . extname ( basename ) . startsWith ( ".h" ) ) {
551
- assert . isDefined ( buildPhaseFiles . find ( ( fileObject : any ) => fileObject . comment . startsWith ( basename ) ) , `${ basename } not added to PBXSourcesBuildPhase` ) ;
551
+ const buildPhaseFile = buildPhaseFiles . find ( ( fileObject : any ) => fileObject . comment . startsWith ( basename ) ) ;
552
+ assert . isDefined ( buildPhaseFile , `${ basename } not added to PBXSourcesBuildPhase` ) ;
553
+ assert . include ( buildPhaseFile . comment , "in Sources" , `${ basename } must be added to Sources group` ) ;
552
554
}
553
555
} else {
554
556
assert . equal ( pbxFileReferenceValues . indexOf ( basename ) , - 1 , `${ basename } was added to PBXFileRefereces, but it shouldn't have been` ) ;
@@ -566,11 +568,19 @@ describe("Source code in plugin support", () => {
566
568
567
569
const pbxFileReference = pbxProj . hash . project . objects . PBXFileReference ;
568
570
const pbxFileReferenceValues = Object . keys ( pbxFileReference ) . map ( key => pbxFileReference [ key ] ) ;
571
+ const buildPhaseFiles = pbxProj . hash . project . objects . PBXResourcesBuildPhase [ "858B842C18CA22B800AB12DE" ] . files ;
569
572
570
573
resFileNames . forEach ( filename => {
571
574
const dirName = path . dirname ( filename ) ;
572
575
const fileToCheck = dirName . endsWith ( ".bundle" ) ? dirName : filename ;
573
- assert . isTrue ( pbxFileReferenceValues . indexOf ( path . basename ( fileToCheck ) ) !== - 1 , `Resource ${ filename } not added to PBXFileRefereces` ) ;
576
+ const basename = path . basename ( fileToCheck ) ;
577
+
578
+ assert . isTrue ( pbxFileReferenceValues . indexOf ( basename ) !== - 1 , `Resource ${ filename } not added to PBXFileRefereces` ) ;
579
+
580
+ const buildPhaseFile = buildPhaseFiles . find ( ( fileObject : any ) => fileObject . comment . startsWith ( basename ) ) ;
581
+ assert . isDefined ( buildPhaseFile , `${ fileToCheck } not added to PBXResourcesBuildPhase` ) ;
582
+ assert . include ( buildPhaseFile . comment , "in Resources" , `${ fileToCheck } must be added to Resources group` ) ;
583
+
574
584
} ) ;
575
585
} ) ;
576
586
}
0 commit comments