@@ -561,23 +561,50 @@ describe('Functional tests using webpack', function() {
561
561
it ( 'createdSharedEntry() creates commons files' , ( done ) => {
562
562
const config = createWebpackConfig ( 'www/build' , 'dev' ) ;
563
563
config . setPublicPath ( '/build' ) ;
564
- config . addEntry ( 'main' , [ './js/no_require' , './js/code_splitting' ] ) ;
564
+ config . addEntry ( 'main' , [ './js/no_require' , './js/code_splitting' , './js/arrow_function' , './js/print_to_app' ] ) ;
565
565
config . addEntry ( 'other' , [ './js/no_require' ] ) ;
566
- config . createSharedEntry ( 'vendor' , './js/no_require' ) ;
566
+ config . createSharedEntry ( 'vendor' , [ './js/no_require' , './js/requires_arrow_function' ] ) ;
567
567
568
568
testSetup . runWebpack ( config , ( webpackAssert ) => {
569
569
// check the file is extracted correctly
570
570
webpackAssert . assertOutputFileContains (
571
571
'vendor.js' ,
572
572
'i am the no_require.js file'
573
573
) ;
574
- // we should also have a manifest file with the webpack bootstrap code
575
574
webpackAssert . assertOutputFileContains (
576
- 'manifest.js' ,
575
+ 'vendor.js' ,
576
+ 'arrow_function.js is ready for action'
577
+ ) ;
578
+
579
+ // check that there is NOT duplication
580
+ webpackAssert . assertOutputFileDoesNotContain (
581
+ 'main.js' ,
582
+ 'i am the no_require.js file'
583
+ ) ;
584
+ webpackAssert . assertOutputFileDoesNotContain (
585
+ 'main.js' ,
586
+ 'arrow_function.js is ready for action'
587
+ ) ;
588
+
589
+ // we should also have a runtime file with the webpack bootstrap code
590
+ webpackAssert . assertOutputFileContains (
591
+ 'runtime.js' ,
577
592
'function __webpack_require__'
578
593
) ;
579
594
580
- done ( ) ;
595
+ testSetup . requestTestPage (
596
+ path . join ( config . getContext ( ) , 'www' ) ,
597
+ [
598
+ 'build/runtime.js' ,
599
+ 'build/vendor.js' ,
600
+ 'build/main.js'
601
+ ] ,
602
+ ( browser ) => {
603
+ // assert that the javascript executed
604
+ browser . assert . text ( '#app' , 'Welcome to Encore!' ) ;
605
+ done ( ) ;
606
+ }
607
+ ) ;
581
608
} ) ;
582
609
} ) ;
583
610
0 commit comments