Skip to content

Commit b89d0b1

Browse files
tzraikovrosen-vladimirov
authored andcommitted
Fixed: test command fails with exception (#2428)
1 parent 964cffb commit b89d0b1

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

lib/services/test-execution-service.ts

+5-19
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class TestExecutionService implements ITestExecutionService {
1616
private $projectData: IProjectData,
1717
private $platformService: IPlatformService,
1818
private $platformsData: IPlatformsData,
19-
private $liveSyncProvider: ILiveSyncProvider,
19+
private $usbLiveSyncService: ILiveSyncService,
2020
private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants,
2121
private $httpClient: Server.IHttpClient,
2222
private $config: IConfiguration,
@@ -59,7 +59,8 @@ class TestExecutionService implements ITestExecutionService {
5959
}
6060
this.detourEntryPoint(projectFilesPath);
6161

62-
this.liveSyncProject(platform);
62+
await this.$platformService.deployPlatform(platform);
63+
await this.$usbLiveSyncService.liveSync(platform);
6364

6465
if (this.$options.debugBrk) {
6566
this.$logger.info('Starting debugger...');
@@ -118,7 +119,8 @@ class TestExecutionService implements ITestExecutionService {
118119
if (this.$options.debugBrk) {
119120
await this.getDebugService(platform).debug();
120121
} else {
121-
await this.liveSyncProject(platform);
122+
await this.$platformService.deployPlatform(platform);
123+
await this.$usbLiveSyncService.liveSync(platform);
122124
}
123125
};
124126

@@ -217,21 +219,5 @@ class TestExecutionService implements ITestExecutionService {
217219

218220
return karmaConfig;
219221
}
220-
221-
private async liveSyncProject(platform: string): Promise<void> {
222-
let platformData = this.$platformsData.getPlatformData(platform.toLowerCase()),
223-
projectFilesPath = path.join(platformData.appDestinationDirectoryPath, constants.APP_FOLDER_NAME);
224-
225-
let liveSyncData: ILiveSyncData = {
226-
platform: platform,
227-
appIdentifier: this.$projectData.projectId,
228-
projectFilesPath: projectFilesPath,
229-
syncWorkingDirectory: path.join(this.$projectData.projectDir, constants.APP_FOLDER_NAME),
230-
excludedProjectDirsAndFiles: this.$options.release ? constants.LIVESYNC_EXCLUDED_FILE_PATTERNS : []
231-
};
232-
233-
let liveSyncService = this.$injector.resolve(this.$liveSyncProvider.platformSpecificLiveSyncServices[platform.toLowerCase()], { _liveSyncData: liveSyncData });
234-
await liveSyncService.fullSync();
235-
}
236222
}
237223
$injector.register('testExecutionService', TestExecutionService);

0 commit comments

Comments
 (0)