Skip to content

Commit 3815222

Browse files
authored
Fixed: test command fails with exception (#2428)
1 parent c53e36f commit 3815222

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

lib/services/test-execution-service.ts

+5-21
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class TestExecutionService implements ITestExecutionService {
1818
private $projectData: IProjectData,
1919
private $platformService: IPlatformService,
2020
private $platformsData: IPlatformsData,
21-
private $liveSyncProvider: ILiveSyncProvider,
21+
private $usbLiveSyncService: ILiveSyncService,
2222
private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants,
2323
private $resources: IResourceLoader,
2424
private $httpClient: Server.IHttpClient,
@@ -64,7 +64,8 @@ class TestExecutionService implements ITestExecutionService {
6464
}
6565
this.detourEntryPoint(projectFilesPath);
6666

67-
this.liveSyncProject(platform);
67+
this.$platformService.deployPlatform(platform).wait();
68+
this.$usbLiveSyncService.liveSync(platform).wait();
6869

6970
if (this.$options.debugBrk) {
7071
this.$logger.info('Starting debugger...');
@@ -130,7 +131,8 @@ class TestExecutionService implements ITestExecutionService {
130131
if (this.$options.debugBrk) {
131132
this.getDebugService(platform).debug().wait();
132133
} else {
133-
this.liveSyncProject(platform).wait();
134+
this.$platformService.deployPlatform(platform).wait();
135+
this.$usbLiveSyncService.liveSync(platform).wait();
134136
}
135137
});
136138
});
@@ -222,23 +224,5 @@ class TestExecutionService implements ITestExecutionService {
222224

223225
return karmaConfig;
224226
}
225-
226-
private liveSyncProject(platform: string): IFuture<void> {
227-
return (() => {
228-
let platformData = this.$platformsData.getPlatformData(platform.toLowerCase()),
229-
projectFilesPath = path.join(platformData.appDestinationDirectoryPath, constants.APP_FOLDER_NAME);
230-
231-
let liveSyncData: ILiveSyncData = {
232-
platform: platform,
233-
appIdentifier: this.$projectData.projectId,
234-
projectFilesPath: projectFilesPath,
235-
syncWorkingDirectory: path.join(this.$projectData.projectDir, constants.APP_FOLDER_NAME),
236-
excludedProjectDirsAndFiles: this.$options.release ? constants.LIVESYNC_EXCLUDED_FILE_PATTERNS : []
237-
};
238-
239-
let liveSyncService = this.$injector.resolve(this.$liveSyncProvider.platformSpecificLiveSyncServices[platform.toLowerCase()], { _liveSyncData: liveSyncData });
240-
liveSyncService.fullSync().wait();
241-
}).future<void>()();
242-
}
243227
}
244228
$injector.register('testExecutionService', TestExecutionService);

0 commit comments

Comments
 (0)