@@ -59,25 +59,7 @@ export class TestExecutionService implements ITestExecutionService {
59
59
this . $fs . writeFile ( path . join ( projectDir , TestExecutionService . CONFIG_FILE_NAME ) , configJs ) ;
60
60
}
61
61
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 ) ;
81
63
82
64
let devices = [ ] ;
83
65
if ( this . $options . debugBrk ) {
@@ -230,5 +212,32 @@ export class TestExecutionService implements ITestExecutionService {
230
212
231
213
return karmaConfig ;
232
214
}
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
+ }
233
242
}
234
243
$injector . register ( 'testExecutionService' , TestExecutionService ) ;
0 commit comments