From b8ab6e86dbfe9e34ee08b3c69e5941a343bf3c73 Mon Sep 17 00:00:00 2001 From: Tsvetan Raikov Date: Mon, 16 Jan 2017 12:18:55 +0200 Subject: [PATCH] Fixed: test command fails with exception --- lib/services/test-execution-service.ts | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/lib/services/test-execution-service.ts b/lib/services/test-execution-service.ts index 4fb01eea36..840448fb4d 100644 --- a/lib/services/test-execution-service.ts +++ b/lib/services/test-execution-service.ts @@ -18,7 +18,7 @@ class TestExecutionService implements ITestExecutionService { private $projectData: IProjectData, private $platformService: IPlatformService, private $platformsData: IPlatformsData, - private $liveSyncProvider: ILiveSyncProvider, + private $usbLiveSyncService: ILiveSyncService, private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, private $resources: IResourceLoader, private $httpClient: Server.IHttpClient, @@ -64,7 +64,8 @@ class TestExecutionService implements ITestExecutionService { } this.detourEntryPoint(projectFilesPath); - this.liveSyncProject(platform); + this.$platformService.deployPlatform(platform).wait(); + this.$usbLiveSyncService.liveSync(platform).wait(); if (this.$options.debugBrk) { this.$logger.info('Starting debugger...'); @@ -130,7 +131,8 @@ class TestExecutionService implements ITestExecutionService { if (this.$options.debugBrk) { this.getDebugService(platform).debug().wait(); } else { - this.liveSyncProject(platform).wait(); + this.$platformService.deployPlatform(platform).wait(); + this.$usbLiveSyncService.liveSync(platform).wait(); } }); }); @@ -222,23 +224,5 @@ class TestExecutionService implements ITestExecutionService { return karmaConfig; } - - private liveSyncProject(platform: string): IFuture { - return (() => { - let platformData = this.$platformsData.getPlatformData(platform.toLowerCase()), - projectFilesPath = path.join(platformData.appDestinationDirectoryPath, constants.APP_FOLDER_NAME); - - let liveSyncData: ILiveSyncData = { - platform: platform, - appIdentifier: this.$projectData.projectId, - projectFilesPath: projectFilesPath, - syncWorkingDirectory: path.join(this.$projectData.projectDir, constants.APP_FOLDER_NAME), - excludedProjectDirsAndFiles: this.$options.release ? constants.LIVESYNC_EXCLUDED_FILE_PATTERNS : [] - }; - - let liveSyncService = this.$injector.resolve(this.$liveSyncProvider.platformSpecificLiveSyncServices[platform.toLowerCase()], { _liveSyncData: liveSyncData }); - liveSyncService.fullSync().wait(); - }).future()(); - } } $injector.register('testExecutionService', TestExecutionService);