@@ -177,47 +177,6 @@ describe('Basic end-to-end Workflow', function () {
177
177
} ) ;
178
178
} ) ;
179
179
180
- it ( 'Serve and run e2e tests after initial build' , function ( ) {
181
- this . timeout ( 240000 ) ;
182
-
183
- var ngServePid ;
184
-
185
- function executor ( resolve , reject ) {
186
- var serveProcess = child_process . exec ( `${ ngBin } serve` , { maxBuffer : 500 * 1024 } ) ;
187
- var startedProtractor = false ;
188
- ngServePid = serveProcess . pid ;
189
-
190
- serveProcess . stdout . on ( 'data' , ( data ) => {
191
- if ( / w e b p a c k : b u n d l e i s n o w V A L I D / . test ( data . toString ( 'utf-8' ) ) && ! startedProtractor ) {
192
- startedProtractor = true ;
193
- child_process . exec ( `${ ngBin } e2e` , ( error , stdout , stderr ) => {
194
- if ( error !== null ) {
195
- reject ( stderr )
196
- } else {
197
- resolve ( ) ;
198
- }
199
- } ) ;
200
- }
201
- } ) ;
202
-
203
- serveProcess . stderr . on ( 'data' , ( data ) => {
204
- reject ( data ) ;
205
- } ) ;
206
- serveProcess . on ( 'close' , ( code ) => {
207
- code === 0 ? resolve ( ) : reject ( 'ng serve command closed with error' )
208
- } ) ;
209
- }
210
-
211
- return new Promise ( executor )
212
- . then ( ( ) => {
213
- if ( ngServePid ) treeKill ( ngServePid ) ;
214
- } )
215
- . catch ( ( msg ) => {
216
- if ( ngServePid ) treeKill ( ngServePid ) ;
217
- throw new Error ( msg ) ;
218
- } ) ;
219
- } ) ;
220
-
221
180
it ( 'Can create a test component using `ng generate component test-component`' , function ( ) {
222
181
this . timeout ( 10000 ) ;
223
182
return ng ( [ 'generate' , 'component' , 'test-component' ] ) . then ( function ( ) {
@@ -453,7 +412,7 @@ describe('Basic end-to-end Workflow', function () {
453
412
expect ( indexHtml ) . to . include ( 'main.bundle.js' ) ;
454
413
} ) ;
455
414
456
- it ( 'Serve and run e2e tests after all other commands ' , function ( ) {
415
+ it ( 'Serve and run e2e tests on dev environment ' , function ( ) {
457
416
this . timeout ( 240000 ) ;
458
417
459
418
var ngServePid ;
@@ -493,6 +452,47 @@ describe('Basic end-to-end Workflow', function () {
493
452
throw new Error ( msg ) ;
494
453
} ) ;
495
454
} ) ;
455
+
456
+ it ( 'Serve and run e2e tests on prod environment' , function ( ) {
457
+ this . timeout ( 240000 ) ;
458
+
459
+ var ngServePid ;
460
+
461
+ function executor ( resolve , reject ) {
462
+ var serveProcess = child_process . exec ( `${ ngBin } serve -e=prod` , { maxBuffer : 500 * 1024 } ) ;
463
+ var startedProtractor = false ;
464
+ ngServePid = serveProcess . pid ;
465
+
466
+ serveProcess . stdout . on ( 'data' , ( data ) => {
467
+ if ( / w e b p a c k : b u n d l e i s n o w V A L I D / . test ( data . toString ( 'utf-8' ) ) && ! startedProtractor ) {
468
+ startedProtractor = true ;
469
+ child_process . exec ( `${ ngBin } e2e` , ( error , stdout , stderr ) => {
470
+ if ( error !== null ) {
471
+ reject ( stderr )
472
+ } else {
473
+ resolve ( ) ;
474
+ }
475
+ } ) ;
476
+ }
477
+ } ) ;
478
+
479
+ serveProcess . stderr . on ( 'data' , ( data ) => {
480
+ reject ( data ) ;
481
+ } ) ;
482
+ serveProcess . on ( 'close' , ( code ) => {
483
+ code === 0 ? resolve ( ) : reject ( 'ng serve command closed with error' )
484
+ } ) ;
485
+ }
486
+
487
+ return new Promise ( executor )
488
+ . then ( ( ) => {
489
+ if ( ngServePid ) treeKill ( ngServePid ) ;
490
+ } )
491
+ . catch ( ( msg ) => {
492
+ if ( ngServePid ) treeKill ( ngServePid ) ;
493
+ throw new Error ( msg ) ;
494
+ } ) ;
495
+ } ) ;
496
496
} ) ;
497
497
498
498
function isMobileTest ( ) {
0 commit comments