@@ -363,28 +363,32 @@ describe('FastBoot', function() {
363363 . then ( html => expect ( html ) . to . match ( / W e l c o m e t o E m b e r / ) ) ;
364364 } ) ;
365365
366- it ( 'reloads the config when package.json changes' , function ( ) {
366+ it ( 'reloads the config when package.json changes' , async function ( ) {
367367 var distPath = fixture ( 'config-swap-app' ) ;
368368 var packagePath = path . join ( distPath , 'package.json' ) ;
369369 var package1Path = path . join ( distPath , 'package-1.json' ) ;
370370 var package2Path = path . join ( distPath , 'package-2.json' ) ;
371371
372372 copyPackage ( package1Path ) ;
373+
373374 var fastboot = new FastBoot ( {
374375 distPath : distPath ,
375376 } ) ;
376377
377- return fastboot
378- . visit ( '/' )
379- . then ( r => r . html ( ) )
380- . then ( html => expect ( html ) . to . match ( / C o n f i g f o o : b a r / ) )
381- . then ( ( ) => deletePackage ( ) )
382- . then ( ( ) => copyPackage ( package2Path ) )
383- . then ( hotReloadApp )
384- . then ( ( ) => fastboot . visit ( '/' ) )
385- . then ( r => r . html ( ) )
386- . then ( html => expect ( html ) . to . match ( / C o n f i g f o o : b o o / ) )
387- . finally ( ( ) => deletePackage ( ) ) ;
378+ try {
379+ await fastboot
380+ . visit ( '/' )
381+ . then ( r => r . html ( ) )
382+ . then ( html => expect ( html ) . to . match ( / C o n f i g f o o : b a r / ) )
383+ . then ( ( ) => deletePackage ( ) )
384+ . then ( ( ) => copyPackage ( package2Path ) )
385+ . then ( hotReloadApp )
386+ . then ( ( ) => fastboot . visit ( '/' ) )
387+ . then ( r => r . html ( ) )
388+ . then ( html => expect ( html ) . to . match ( / C o n f i g f o o : b o o / ) ) ;
389+ } finally {
390+ deletePackage ( ) ;
391+ }
388392
389393 function hotReloadApp ( ) {
390394 fastboot . reload ( {
0 commit comments