Skip to content

Commit dea71ce

Browse files
Fix debug when using CLI as library (#2984)
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.
1 parent 82d6abc commit dea71ce

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/services/debug-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class DebugService extends EventEmitter implements IDebugService {
6464
result = await debugService.debug(debugData, debugOptions);
6565
}
6666

67-
return _.first(result);
67+
return result;
6868
}
6969

7070
public getDebugService(device: Mobile.IDevice): IPlatformDebugService {

test/services/debug-service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import { CONNECTION_ERROR_EVENT_NAME } from "../../lib/constants";
88

99
const fakeChromeDebugUrl = "fakeChromeDebugUrl";
1010
class PlatformDebugService extends EventEmitter /* implements IPlatformDebugService */ {
11-
public async debug(debugData: IDebugData, debugOptions: IDebugOptions): Promise<string[]> {
12-
return [fakeChromeDebugUrl];
11+
public async debug(debugData: IDebugData, debugOptions: IDebugOptions): Promise<string> {
12+
return fakeChromeDebugUrl;
1313
}
1414
}
1515

0 commit comments

Comments
 (0)