@@ -89,19 +89,21 @@ describe('Basic end-to-end Workflow', function () {
89
89
expect ( mainBundleContent ) . to . include ( 'production:!0' ) ;
90
90
} ) ;
91
91
92
- it_mobile ( 'Enables mobile-specific production features' , ( ) => {
93
- let index = fs . readFileSync ( path . join ( process . cwd ( ) , 'dist/index.html' ) , 'utf-8' ) ;
92
+ it_mobile ( 'Enables mobile-specific production features in prod builds ' , ( ) => {
93
+ let indexHtml = fs . readFileSync ( path . join ( process . cwd ( ) , 'dist/index.html' ) , 'utf-8' ) ;
94
94
// Service Worker
95
- expect ( index . includes ( 'if (\'serviceWorker\' in navigator) {' ) ) . to . be . equal ( true ) ;
96
- expect ( existsSync ( path . join ( process . cwd ( ) , 'dist/worker.js' ) ) ) . to . be . equal ( true ) ;
97
-
98
- // Asynchronous bundle
99
- expect ( index . includes ( '<script src="/app-concat.js" async=""></script>' ) ) . to . be . equal ( true ) ;
100
- expect ( existsSync ( path . join ( process . cwd ( ) , 'dist/app-concat.js' ) ) ) . to . be . equal ( true ) ;
95
+ expect ( indexHtml ) . to . match ( / s w - i n s t a l l \. [ 0 - 9 a - f ] { 20 } \. b u n d l e \. j s / ) ;
96
+ expect ( existsSync ( path . join ( process . cwd ( ) , 'dist/sw.js' ) ) ) . to . be . equal ( true ) ;
101
97
102
98
// App Manifest
103
- expect ( index . includes ( '<link rel="manifest" href="/manifest.webapp">' ) ) . to . be . equal ( true ) ;
99
+ expect ( indexHtml . includes ( '<link rel="manifest" href="/manifest.webapp">' ) ) . to . be . equal ( true ) ;
104
100
expect ( existsSync ( path . join ( process . cwd ( ) , 'dist/manifest.webapp' ) ) ) . to . be . equal ( true ) ;
101
+
102
+ // Icons folder
103
+ expect ( existsSync ( path . join ( process . cwd ( ) , 'dist/icons' ) ) ) . to . be . equal ( true ) ;
104
+
105
+ // Prerender content
106
+ expect ( indexHtml ) . to . match ( / a p p w o r k s ! / ) ;
105
107
} ) ;
106
108
107
109
it ( 'Can run `ng build` in created project' , function ( ) {
0 commit comments