@@ -59,25 +59,7 @@ export class TestExecutionService implements ITestExecutionService {
5959 this . $fs . writeFile ( path . join ( projectDir , TestExecutionService . CONFIG_FILE_NAME ) , configJs ) ;
6060 }
6161
62- const appFilesUpdaterOptions : IAppFilesUpdaterOptions = {
63- bundle : ! ! this . $options . bundle ,
64- release : this . $options . release ,
65- useHotModuleReload : this . $options . hmr
66- } ;
67- const preparePlatformInfo : IPreparePlatformInfo = {
68- platform,
69- appFilesUpdaterOptions,
70- platformTemplate : this . $options . platformTemplate ,
71- projectData,
72- config : this . $options ,
73- env : this . $options . env
74- } ;
75-
76- // Prepare the project AFTER the TestExecutionService.CONFIG_FILE_NAME file is created in node_modules
77- // so it will be sent to device.
78- if ( ! await this . $platformService . preparePlatform ( preparePlatformInfo ) ) {
79- this . $errors . failWithoutHelp ( "Verify that listed files are well-formed and try again the operation." ) ;
80- }
62+ await this . preparePlatform ( projectData , platform ) ;
8163
8264 let devices = [ ] ;
8365 if ( this . $options . debugBrk ) {
@@ -230,5 +212,32 @@ export class TestExecutionService implements ITestExecutionService {
230212
231213 return karmaConfig ;
232214 }
215+
216+ private async preparePlatform ( projectData : IProjectData , platform : string ) : Promise < void > {
217+ if ( this . $options . bundle ) {
218+ return ;
219+ }
220+
221+ const appFilesUpdaterOptions : IAppFilesUpdaterOptions = {
222+ bundle : ! ! this . $options . bundle ,
223+ release : this . $options . release ,
224+ useHotModuleReload : this . $options . hmr
225+ } ;
226+ const preparePlatformInfo : IPreparePlatformInfo = {
227+ platform,
228+ appFilesUpdaterOptions,
229+ platformTemplate : this . $options . platformTemplate ,
230+ projectData,
231+ config : this . $options ,
232+ env : this . $options . env
233+ } ;
234+
235+ // Prepare the project AFTER the TestExecutionService.CONFIG_FILE_NAME file is created in node_modules
236+ // so it will be sent to device.
237+ const isPlatformPrepared = await this . $platformService . preparePlatform ( preparePlatformInfo ) ;
238+ if ( ! isPlatformPrepared ) {
239+ this . $errors . failWithoutHelp ( "Verify that listed files are well-formed and try again the operation." ) ;
240+ }
241+ }
233242}
234243$injector . register ( 'testExecutionService' , TestExecutionService ) ;
0 commit comments