@@ -5932,4 +5932,36 @@ describe('scope hoisting', function() {
5932
5932
let res = await run ( b , { output : null } , { require : false } ) ;
5933
5933
assert . equal ( res . output , 'a' ) ;
5934
5934
} ) ;
5935
+
5936
+ it ( 'should unmark dependency as deferred when dependency becomes used' , async function ( ) {
5937
+ let testDir = path . join (
5938
+ __dirname ,
5939
+ 'integration/scope-hoisting/es6/unmarks-defer-for-new-deps' ,
5940
+ ) ;
5941
+
5942
+ let packageDir = path . join ( testDir , '/package' ) ;
5943
+
5944
+ await overlayFS . mkdirp ( packageDir ) ;
5945
+ await overlayFS . copyFile (
5946
+ path . join ( packageDir , 'b1.js' ) ,
5947
+ path . join ( packageDir , 'b.js' ) ,
5948
+ ) ;
5949
+
5950
+ await bundle ( path . join ( testDir , 'index.js' ) , {
5951
+ inputFS : overlayFS ,
5952
+ outputFS : overlayFS ,
5953
+ shouldDisableCache : true ,
5954
+ } ) ;
5955
+
5956
+ await overlayFS . copyFile (
5957
+ path . join ( packageDir , 'b2.js' ) ,
5958
+ path . join ( packageDir , 'b.js' ) ,
5959
+ ) ;
5960
+
5961
+ await bundle ( path . join ( testDir , 'index.js' ) , {
5962
+ inputFS : overlayFS ,
5963
+ outputFS : overlayFS ,
5964
+ shouldDisableCache : false ,
5965
+ } ) ;
5966
+ } ) ;
5935
5967
} ) ;
0 commit comments