@@ -23,10 +23,7 @@ const DEFAULT_CLI_EXAMPLE_PORT = 4200;
2323const DEFAULT_CLI_SPECS_CONCURRENCY = 1 ;
2424const IGNORED_EXAMPLES = [ ] ;
2525
26- const fixmeIvyExamples = [
27- // fixmeIvy('unknown') app fails at runtime due to missing external service (goog is undefined)
28- 'i18n' ,
29- ] ;
26+ const fixmeIvyExamples = [ ] ;
3027
3128if ( ! argv . viewengine ) {
3229 IGNORED_EXAMPLES . push ( ...fixmeIvyExamples ) ;
@@ -72,8 +69,10 @@ function runE2e() {
7269 const outputFile = path . join ( AIO_PATH , './protractor-results.txt' ) ;
7370
7471 return Promise . resolve ( )
75- . then ( ( ) => findAndRunE2eTests ( argv . filter , outputFile , argv . shard ,
76- argv . cliSpecsConcurrency || DEFAULT_CLI_SPECS_CONCURRENCY , argv . retry || 1 ) )
72+ . then (
73+ ( ) => findAndRunE2eTests (
74+ argv . filter , outputFile , argv . shard ,
75+ argv . cliSpecsConcurrency || DEFAULT_CLI_SPECS_CONCURRENCY , argv . retry || 1 ) )
7776 . then ( ( status ) => {
7877 reportStatus ( status , outputFile ) ;
7978 if ( status . failed . length > 0 ) {
@@ -226,8 +225,12 @@ function runProtractorSystemJS(prepPromise, appDir, appRunSpawnInfo, outputFile)
226225 } ) ;
227226 } )
228227 . then (
229- function ( ) { return finish ( appRunSpawnInfo . proc . pid , true ) ; } ,
230- function ( ) { return finish ( appRunSpawnInfo . proc . pid , false ) ; } ) ;
228+ function ( ) {
229+ return finish ( appRunSpawnInfo . proc . pid , true ) ;
230+ } ,
231+ function ( ) {
232+ return finish ( appRunSpawnInfo . proc . pid , false ) ;
233+ } ) ;
231234}
232235
233236function finish ( spawnProcId , ok ) {
@@ -263,15 +266,15 @@ function runE2eTestsCLI(appDir, outputFile, bufferOutput, port) {
263266 // `--no-webdriver-update` is needed to preserve the ChromeDriver version already installed.
264267 const config = loadExampleConfig ( appDir ) ;
265268 const testCommands = config . tests || [ {
266- cmd : 'yarn' ,
267- args : [
268- 'e2e' ,
269- '--prod' ,
270- '--protractor-config=e2e/protractor-puppeteer.conf.js' ,
271- '--no-webdriver-update' ,
272- '--port={PORT}' ,
273- ] ,
274- } ] ;
269+ cmd : 'yarn' ,
270+ args : [
271+ 'e2e' ,
272+ '--prod' ,
273+ '--protractor-config=e2e/protractor-puppeteer.conf.js' ,
274+ '--no-webdriver-update' ,
275+ '--port={PORT}' ,
276+ ] ,
277+ } ] ;
275278 let bufferedOutput = `\n\n============== AIO example output for: ${ appDir } \n\n` ;
276279
277280 const e2eSpawnPromise = testCommands . reduce ( ( prevSpawnPromise , { cmd, args} ) => {
@@ -281,26 +284,30 @@ function runE2eTestsCLI(appDir, outputFile, bufferOutput, port) {
281284 args = args . map ( a => a . replace ( '{PORT}' , port || DEFAULT_CLI_EXAMPLE_PORT ) ) ;
282285
283286 return prevSpawnPromise . then ( ( ) => {
284- const currSpawn = spawnExt ( cmd , args , { cwd : appDir } , false ,
285- bufferOutput ? msg => bufferedOutput += msg : undefined ) ;
287+ const currSpawn = spawnExt (
288+ cmd , args , { cwd : appDir } , false , bufferOutput ? msg => bufferedOutput += msg : undefined ) ;
286289 return currSpawn . promise . then (
287290 ( ) => Promise . resolve ( finish ( currSpawn . proc . pid , true ) ) ,
288291 ( ) => Promise . reject ( finish ( currSpawn . proc . pid , false ) ) ) ;
289292 } ) ;
290293 } , Promise . resolve ( ) ) ;
291294
292- return e2eSpawnPromise . then ( ( ) => {
293- fs . appendFileSync ( outputFile , `Passed: ${ appDir } \n\n` ) ;
294- return true ;
295- } , ( ) => {
296- fs . appendFileSync ( outputFile , `Failed: ${ appDir } \n\n` ) ;
297- return false ;
298- } ) . then ( passed => {
299- if ( bufferOutput ) {
300- process . stdout . write ( bufferedOutput ) ;
301- }
302- return passed ;
303- } ) ;
295+ return e2eSpawnPromise
296+ . then (
297+ ( ) => {
298+ fs . appendFileSync ( outputFile , `Passed: ${ appDir } \n\n` ) ;
299+ return true ;
300+ } ,
301+ ( ) => {
302+ fs . appendFileSync ( outputFile , `Failed: ${ appDir } \n\n` ) ;
303+ return false ;
304+ } )
305+ . then ( passed => {
306+ if ( bufferOutput ) {
307+ process . stdout . write ( bufferedOutput ) ;
308+ }
309+ return passed ;
310+ } ) ;
304311}
305312
306313// Report final status.
@@ -309,23 +316,31 @@ function reportStatus(status, outputFile) {
309316
310317 log . push ( 'Suites ignored due to legacy guides:' ) ;
311318 IGNORED_EXAMPLES . filter ( example => ! fixmeIvyExamples . find ( ex => ex . startsWith ( example ) ) )
312- . forEach ( function ( val ) { log . push ( ' ' + val ) ; } ) ;
319+ . forEach ( function ( val ) {
320+ log . push ( ' ' + val ) ;
321+ } ) ;
313322
314323 if ( ! argv . viewengine ) {
315324 log . push ( '' ) ;
316325 log . push ( 'Suites ignored due to breakage with Ivy:' ) ;
317- fixmeIvyExamples . forEach ( function ( val ) { log . push ( ' ' + val ) ; } ) ;
326+ fixmeIvyExamples . forEach ( function ( val ) {
327+ log . push ( ' ' + val ) ;
328+ } ) ;
318329 }
319330
320331 log . push ( '' ) ;
321332 log . push ( 'Suites passed:' ) ;
322- status . passed . forEach ( function ( val ) { log . push ( ' ' + val ) ; } ) ;
333+ status . passed . forEach ( function ( val ) {
334+ log . push ( ' ' + val ) ;
335+ } ) ;
323336
324337 if ( status . failed . length == 0 ) {
325338 log . push ( 'All tests passed' ) ;
326339 } else {
327340 log . push ( 'Suites failed:' ) ;
328- status . failed . forEach ( function ( val ) { log . push ( ' ' + val ) ; } ) ;
341+ status . failed . forEach ( function ( val ) {
342+ log . push ( ' ' + val ) ;
343+ } ) ;
329344 }
330345 log . push ( '\nElapsed time: ' + status . elapsedTime + ' seconds' ) ;
331346 log = log . join ( '\n' ) ;
@@ -334,8 +349,8 @@ function reportStatus(status, outputFile) {
334349}
335350
336351// Returns both a promise and the spawned process so that it can be killed if needed.
337- function spawnExt ( command , args , options , ignoreClose = false ,
338- printMessage = msg => process . stdout . write ( msg ) ) {
352+ function spawnExt (
353+ command , args , options , ignoreClose = false , printMessage = msg => process . stdout . write ( msg ) ) {
339354 let proc ;
340355 const promise = new Promise ( ( resolve , reject ) => {
341356 let descr = command + ' ' + args . join ( ' ' ) ;
@@ -370,13 +385,19 @@ function getE2eSpecs(basePath, filter) {
370385 let specs = { } ;
371386
372387 return getE2eSpecsFor ( basePath , SJS_SPEC_FILENAME , filter )
373- . then ( sjsPaths => { specs . systemjs = sjsPaths ; } )
388+ . then ( sjsPaths => {
389+ specs . systemjs = sjsPaths ;
390+ } )
374391 . then ( ( ) => {
375392 return getE2eSpecsFor ( basePath , CLI_SPEC_FILENAME , filter ) . then ( cliPaths => {
376- return cliPaths . map ( p => { return p . replace ( `${ CLI_SPEC_FILENAME } ` , '' ) ; } ) ;
393+ return cliPaths . map ( p => {
394+ return p . replace ( `${ CLI_SPEC_FILENAME } ` , '' ) ;
395+ } ) ;
377396 } ) ;
378397 } )
379- . then ( cliPaths => { specs . cli = cliPaths ; } )
398+ . then ( cliPaths => {
399+ specs . cli = cliPaths ;
400+ } )
380401 . then ( ( ) => specs ) ;
381402}
382403
0 commit comments