From 61b7c4cd148dd9bec00c7e39e4f23373e07a7a61 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Wed, 19 Jul 2017 13:00:04 +0300 Subject: [PATCH] Fix debug when using CLI as library When CLI is used as a library, the method for debug returns incorrect result - previously the return type of the method we are calling was `string[]`, we've changed it to `string` but forgot to remove the `_.first(result)`. So now the debug returns incorrect URL. Remove the `_.first` and return the result directly. --- lib/services/debug-service.ts | 2 +- test/services/debug-service.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/services/debug-service.ts b/lib/services/debug-service.ts index b1ec3b850f..303177379b 100644 --- a/lib/services/debug-service.ts +++ b/lib/services/debug-service.ts @@ -64,7 +64,7 @@ export class DebugService extends EventEmitter implements IDebugService { result = await debugService.debug(debugData, debugOptions); } - return _.first(result); + return result; } public getDebugService(device: Mobile.IDevice): IPlatformDebugService { diff --git a/test/services/debug-service.ts b/test/services/debug-service.ts index f23fa11be8..259550d481 100644 --- a/test/services/debug-service.ts +++ b/test/services/debug-service.ts @@ -8,8 +8,8 @@ import { CONNECTION_ERROR_EVENT_NAME } from "../../lib/constants"; const fakeChromeDebugUrl = "fakeChromeDebugUrl"; class PlatformDebugService extends EventEmitter /* implements IPlatformDebugService */ { - public async debug(debugData: IDebugData, debugOptions: IDebugOptions): Promise { - return [fakeChromeDebugUrl]; + public async debug(debugData: IDebugData, debugOptions: IDebugOptions): Promise { + return fakeChromeDebugUrl; } }