@@ -19,7 +19,6 @@ export class TestExecutionService implements ITestExecutionService {
19
19
private $fs : IFileSystem ,
20
20
private $options : IOptions ,
21
21
private $pluginsService : IPluginsService ,
22
- private $errors : IErrors ,
23
22
private $devicesService : Mobile . IDevicesService ,
24
23
private $childProcess : IChildProcess ) {
25
24
}
@@ -59,25 +58,8 @@ export class TestExecutionService implements ITestExecutionService {
59
58
this . $fs . writeFile ( path . join ( projectDir , TestExecutionService . CONFIG_FILE_NAME ) , configJs ) ;
60
59
}
61
60
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
61
// Prepare the project AFTER the TestExecutionService.CONFIG_FILE_NAME file is created in node_modules
77
62
// 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
- }
81
63
82
64
let devices = [ ] ;
83
65
if ( this . $options . debugBrk ) {
@@ -125,21 +107,29 @@ export class TestExecutionService implements ITestExecutionService {
125
107
return info ;
126
108
} ) ;
127
109
110
+ const env = this . $options . env || { } ;
111
+ env . unitTesting = ! ! this . $options . bundle ;
112
+
128
113
const liveSyncInfo : ILiveSyncInfo = {
129
114
projectDir : projectData . projectDir ,
130
115
skipWatcher : ! this . $options . watch || this . $options . justlaunch ,
131
116
watchAllFiles : this . $options . syncAllFiles ,
132
117
bundle : ! ! this . $options . bundle ,
133
118
release : this . $options . release ,
134
- env : this . $options . env ,
119
+ env,
135
120
timeout : this . $options . timeout ,
136
121
useHotModuleReload : this . $options . hmr
137
122
} ;
138
123
139
124
await this . $liveSyncService . liveSync ( deviceDescriptors , liveSyncInfo ) ;
140
125
} ;
141
126
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
+
143
133
launchKarmaTests ( karmaData )
144
134
. catch ( ( result ) => {
145
135
this . $logger . error ( result ) ;
@@ -207,6 +197,7 @@ export class TestExecutionService implements ITestExecutionService {
207
197
debugTransport : this . $options . debugTransport ,
208
198
debugBrk : this . $options . debugBrk ,
209
199
watch : ! ! this . $options . watch ,
200
+ bundle : ! ! this . $options . bundle ,
210
201
appDirectoryRelativePath : projectData . getAppDirectoryRelativePath ( )
211
202
}
212
203
} ,
@@ -226,6 +217,8 @@ export class TestExecutionService implements ITestExecutionService {
226
217
}
227
218
228
219
karmaConfig . projectDir = projectData . projectDir ;
220
+ karmaConfig . bundle = this . $options . bundle ;
221
+ karmaConfig . platform = platform . toLowerCase ( ) ;
229
222
this . $logger . debug ( JSON . stringify ( karmaConfig , null , 4 ) ) ;
230
223
231
224
return karmaConfig ;
0 commit comments