@@ -19,7 +19,6 @@ export class TestExecutionService implements ITestExecutionService {
1919 private $fs : IFileSystem ,
2020 private $options : IOptions ,
2121 private $pluginsService : IPluginsService ,
22- private $errors : IErrors ,
2322 private $devicesService : Mobile . IDevicesService ,
2423 private $childProcess : IChildProcess ) {
2524 }
@@ -59,25 +58,8 @@ export class TestExecutionService implements ITestExecutionService {
5958 this . $fs . writeFile ( path . join ( projectDir , TestExecutionService . CONFIG_FILE_NAME ) , configJs ) ;
6059 }
6160
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-
7661 // Prepare the project AFTER the TestExecutionService.CONFIG_FILE_NAME file is created in node_modules
7762 // 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- }
8163
8264 let devices = [ ] ;
8365 if ( this . $options . debugBrk ) {
@@ -125,21 +107,29 @@ export class TestExecutionService implements ITestExecutionService {
125107 return info ;
126108 } ) ;
127109
110+ const env = this . $options . env || { } ;
111+ env . unitTesting = ! ! this . $options . bundle ;
112+
128113 const liveSyncInfo : ILiveSyncInfo = {
129114 projectDir : projectData . projectDir ,
130115 skipWatcher : ! this . $options . watch || this . $options . justlaunch ,
131116 watchAllFiles : this . $options . syncAllFiles ,
132117 bundle : ! ! this . $options . bundle ,
133118 release : this . $options . release ,
134- env : this . $options . env ,
119+ env,
135120 timeout : this . $options . timeout ,
136121 useHotModuleReload : this . $options . hmr
137122 } ;
138123
139124 await this . $liveSyncService . liveSync ( deviceDescriptors , liveSyncInfo ) ;
140125 } ;
141126
142- karmaRunner . on ( "message" , ( karmaData : any ) => {
127+ karmaRunner . on ( "message" , ( karmaData : any ) => {
128+ this . $logger . trace ( `The received message from karma is: ` , karmaData ) ;
129+ if ( ! karmaData . launcherConfig && ! karmaData . url ) {
130+ return ;
131+ }
132+
143133 launchKarmaTests ( karmaData )
144134 . catch ( ( result ) => {
145135 this . $logger . error ( result ) ;
@@ -207,6 +197,7 @@ export class TestExecutionService implements ITestExecutionService {
207197 debugTransport : this . $options . debugTransport ,
208198 debugBrk : this . $options . debugBrk ,
209199 watch : ! ! this . $options . watch ,
200+ bundle : ! ! this . $options . bundle ,
210201 appDirectoryRelativePath : projectData . getAppDirectoryRelativePath ( )
211202 }
212203 } ,
@@ -226,6 +217,8 @@ export class TestExecutionService implements ITestExecutionService {
226217 }
227218
228219 karmaConfig . projectDir = projectData . projectDir ;
220+ karmaConfig . bundle = this . $options . bundle ;
221+ karmaConfig . platform = platform . toLowerCase ( ) ;
229222 this . $logger . debug ( JSON . stringify ( karmaConfig , null , 4 ) ) ;
230223
231224 return karmaConfig ;
0 commit comments