File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
packages/bazel/test/ng_package Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ describe('@angular/common ng_package', () => {
3333 } ) ;
3434
3535 it ( 'should have right fesm files' , ( ) => {
36- const expected = [
36+ const expectedFiles = [
3737 'common.mjs' ,
3838 'common.mjs.map' ,
3939 'http' ,
@@ -46,13 +46,18 @@ describe('@angular/common ng_package', () => {
4646 'upgrade.mjs' ,
4747 'upgrade.mjs.map' ,
4848 ] ;
49- expect (
50- shx
51- . ls ( '-R' , 'fesm2022' )
52- . stdout . split ( '\n' )
53- . filter ( ( n ) => ! ! n )
54- . sort ( ) ,
55- ) . toEqual ( expected ) ;
49+ const allFiles = shx
50+ . ls ( '-R' , 'fesm2022' )
51+ . stdout . split ( '\n' )
52+ . filter ( ( n ) => ! ! n )
53+ . sort ( ) ;
54+ // The list of files would contain some shared chunks too (e.g. `location-CprIx2Bv.mjs`),
55+ // so we make sure that the actual list of files properly represent main entrypoints
56+ // (ignoring extra chunks info).
57+ const allFilesAsSet = new Set ( allFiles ) ;
58+ for ( const expectedFile of expectedFiles ) {
59+ expect ( allFilesAsSet . has ( expectedFile ) ) . toBe ( true ) ;
60+ }
5661 } ) ;
5762
5863 it ( 'should have the correct source map paths' , ( ) => {
You can’t perform that action at this time.
0 commit comments