@@ -27,6 +27,11 @@ var appGeneratorPath = path.join(__dirname, '../../../app')
2727var testResourcesPath = path . join ( __dirname , '../../../test/resources' )
2828var extendedTimeout = 300000
2929
30+ // Require config to alter sdkgen delay between
31+ // status checks to speed up unit tests
32+ var config = require ( '../../../config' )
33+ var sdkGenCheckDelaySaved
34+
3035describe ( 'Prompt and no build integration tests for app generator' , function ( ) {
3136 describe ( 'Basic application' , function ( ) {
3237 this . timeout ( 10000 ) // Allow first test to be slow
@@ -222,6 +227,10 @@ describe('Prompt and no build integration tests for app generator', function ()
222227 var appName = 'notes'
223228
224229 before ( function ( ) {
230+ // alter delay between status checks to speed up unit tests
231+ sdkGenCheckDelaySaved = config . sdkGenCheckDelay
232+ config . sdkGenCheckDelay = 10000
233+
225234 runContext = helpers . run ( appGeneratorPath )
226235 . withOptions ( { 'skip-build' : true } )
227236 . withPrompts ( {
@@ -235,6 +244,12 @@ describe('Prompt and no build integration tests for app generator', function ()
235244 return runContext . toPromise ( )
236245 } )
237246
247+ after ( 'restore sdkgen status check delay' , function ( ) {
248+ // restore delay between status checks so integration tests
249+ // remain resilient
250+ config . sdkGenCheckDelay = sdkGenCheckDelaySaved
251+ } )
252+
238253 describe ( 'Static web file serving' , function ( ) {
239254 it ( 'created public web directory' , function ( ) {
240255 assert . file ( 'public' )
@@ -321,6 +336,10 @@ describe('Prompt and no build integration tests for app generator', function ()
321336 var runContext
322337
323338 before ( function ( ) {
339+ // alter delay between status checks to speed up unit tests
340+ sdkGenCheckDelaySaved = config . sdkGenCheckDelay
341+ config . sdkGenCheckDelay = 10000
342+
324343 runContext = helpers . run ( appGeneratorPath )
325344 . withOptions ( { 'skip-build' : true } )
326345 . withPrompts ( {
@@ -336,6 +355,12 @@ describe('Prompt and no build integration tests for app generator', function ()
336355 return runContext . toPromise ( )
337356 } )
338357
358+ after ( 'restore sdkgen status check delay' , function ( ) {
359+ // restore delay between status checks so integration tests
360+ // remain resilient
361+ config . sdkGenCheckDelay = sdkGenCheckDelaySaved
362+ } )
363+
339364 describe ( 'Example endpoints' , function ( ) {
340365 it ( 'created example endpoints' , function ( ) {
341366 assert . file ( `Sources/Application/Routes/PersonsRoutes.swift` )
@@ -350,6 +375,10 @@ describe('Prompt and no build integration tests for app generator', function ()
350375 var appName = 'notes'
351376
352377 before ( function ( ) {
378+ // alter delay between status checks to speed up unit tests
379+ sdkGenCheckDelaySaved = config . sdkGenCheckDelay
380+ config . sdkGenCheckDelay = 10000
381+
353382 runContext = helpers . run ( appGeneratorPath )
354383 . withOptions ( { 'skip-build' : true } )
355384 . withPrompts ( {
@@ -370,6 +399,12 @@ describe('Prompt and no build integration tests for app generator', function ()
370399 return runContext . toPromise ( )
371400 } )
372401
402+ after ( 'restore sdkgen status check delay' , function ( ) {
403+ // restore delay between status checks so integration tests
404+ // remain resilient
405+ config . sdkGenCheckDelay = sdkGenCheckDelaySaved
406+ } )
407+
373408 it ( 'created a iOS SDK zip file' , function ( ) {
374409 assert . file ( appName + '_iOS_SDK.zip' )
375410 } )
0 commit comments