@@ -19,14 +19,17 @@ const project1PackageName: string = 'package-extractor-test-01';
1919const project2PackageName : string = 'package-extractor-test-02' ;
2020const project3PackageName : string = 'package-extractor-test-03' ;
2121const project4PackageName : string = 'package-extractor-test-04' ;
22+ const project5PackageName : string = 'package-extractor-test-05' ;
2223const project1RelativePath : string = path . join ( 'build-tests' , project1PackageName ) ;
2324const project2RelativePath : string = path . join ( 'build-tests' , project2PackageName ) ;
2425const project3RelativePath : string = path . join ( 'build-tests' , project3PackageName ) ;
2526const project4RelativePath : string = path . join ( 'build-tests' , project4PackageName ) ;
27+ const project5RelativePath : string = path . join ( 'build-tests' , project5PackageName ) ;
2628const project1Path : string = path . join ( repoRoot , project1RelativePath ) ;
2729const project2Path : string = path . resolve ( repoRoot , project2RelativePath ) ;
2830const project3Path : string = path . resolve ( repoRoot , project3RelativePath ) ;
2931const project4Path : string = path . resolve ( repoRoot , project4RelativePath ) ;
32+ const project5Path : string = path . resolve ( repoRoot , project5RelativePath ) ;
3033
3134function getDefaultProjectConfigurations ( ) : IExtractorProjectConfiguration [ ] {
3235 return [
@@ -619,4 +622,12 @@ describe(PackageExtractor.name, () => {
619622 Sort . sortBy ( metadata . projects , ( x ) => x . path ) ;
620623 expect ( metadata ) . toMatchSnapshot ( ) ;
621624 } ) ;
625+
626+ it ( 'should normalize and remove duplicate file paths' , async ( ) => {
627+ await FileSystem . writeFileAsync ( path . join ( project5Path , 'dist' , 'index.js' ) , '' , {
628+ ensureFolderExists : true
629+ } ) ;
630+ const result = await PackageExtractor . getPackageIncludedFilesAsync ( project5Path ) ;
631+ expect ( result ) . toEqual ( [ 'dist/index.js' , 'package.json' ] ) ;
632+ } ) ;
622633} ) ;
0 commit comments