@@ -548,7 +548,9 @@ describe("Source code in plugin support", () => {
548548 assert . notEqual ( pbxFileReferenceValues . indexOf ( basename ) , - 1 , `${ basename } not added to PBXFileRefereces` ) ;
549549
550550 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` ) ;
552554 }
553555 } else {
554556 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", () => {
566568
567569 const pbxFileReference = pbxProj . hash . project . objects . PBXFileReference ;
568570 const pbxFileReferenceValues = Object . keys ( pbxFileReference ) . map ( key => pbxFileReference [ key ] ) ;
571+ const buildPhaseFiles = pbxProj . hash . project . objects . PBXResourcesBuildPhase [ "858B842C18CA22B800AB12DE" ] . files ;
569572
570573 resFileNames . forEach ( filename => {
571574 const dirName = path . dirname ( filename ) ;
572575 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+
574584 } ) ;
575585 } ) ;
576586 }
0 commit comments