diff --git a/lib/declarations.d.ts b/lib/declarations.d.ts index 3bff6085fd..c069049d4b 100644 --- a/lib/declarations.d.ts +++ b/lib/declarations.d.ts @@ -473,10 +473,14 @@ interface IGenerateOptions { collection?: string; } -interface IDebugInformation extends IPort, Mobile.IDeviceIdentifier { +interface IDebugInformation extends IPort, Mobile.IDeviceIdentifier, IHasHasReconnected { url: string; } +interface IHasHasReconnected { + hasReconnected: boolean; +} + interface IPort { port: Number; } diff --git a/lib/definitions/debug.d.ts b/lib/definitions/debug.d.ts index 6c8e4eca67..48bbba18f8 100644 --- a/lib/definitions/debug.d.ts +++ b/lib/definitions/debug.d.ts @@ -100,6 +100,10 @@ interface IDebugOptions { * Defines if the handshake(AppLaunching notification) between CLI and runtime should be executed. The handshake is not needed when CLI retries to attach to the debugger. */ skipHandshake?: boolean; + /** + * Forces the debugger attach event to be emitted. + */ + forceDebuggerAttachedEvent?: boolean; } /** @@ -161,5 +165,9 @@ interface IDeviceDebugService extends IPlatform, NodeJS.EventEmitter { * @param {IDebugOptions} debugOptions Describe possible options to modify the behaivor of the debug operation, for example stop on the first line. * @returns {Promise} Full url where the frontend client may be connected. */ - debug(debugData: IAppDebugData, debugOptions: IDebugOptions): Promise; + debug(debugData: IAppDebugData, debugOptions: IDebugOptions): Promise; +} + +interface IDebugResultInfo extends IHasHasReconnected { + debugUrl: string; } diff --git a/lib/definitions/livesync.d.ts b/lib/definitions/livesync.d.ts index 36d153d452..0d2ad574e8 100644 --- a/lib/definitions/livesync.d.ts +++ b/lib/definitions/livesync.d.ts @@ -188,7 +188,7 @@ interface ILiveSyncEventData { applicationIdentifier?: string, projectDir: string, syncedFiles?: string[], - error? : Error, + error?: Error, notification?: string, isFullSync?: boolean } @@ -390,11 +390,18 @@ interface ITransferFilesOptions { interface IPlatformLiveSyncService { fullSync(syncInfo: IFullSyncInfo): Promise; liveSyncWatchAction(device: Mobile.IDevice, liveSyncInfo: ILiveSyncWatchInfo): Promise; - refreshApplication(projectData: IProjectData, liveSyncInfo: ILiveSyncResultInfo): Promise; + refreshApplication(projectData: IProjectData, liveSyncInfo: ILiveSyncResultInfo): Promise; prepareForLiveSync(device: Mobile.IDevice, data: IProjectDir, liveSyncInfo: ILiveSyncInfo, debugOptions: IDebugOptions): Promise; getDeviceLiveSyncService(device: Mobile.IDevice, projectData: IProjectData): INativeScriptDeviceLiveSyncService; } +interface IHasDidRestart { + didRestart: boolean; +} + +interface IRefreshApplicationInfo extends IHasDidRestart { +} + interface INativeScriptDeviceLiveSyncService extends IDeviceLiveSyncServiceBase { /** * Refreshes the application's content on a device @@ -405,7 +412,7 @@ interface INativeScriptDeviceLiveSyncService extends IDeviceLiveSyncServiceBase * @return {Promise} */ refreshApplication(projectData: IProjectData, - liveSyncInfo: ILiveSyncResultInfo): Promise; + liveSyncInfo: ILiveSyncResultInfo): Promise; /** * Removes specified files from a connected device diff --git a/lib/services/android-device-debug-service.ts b/lib/services/android-device-debug-service.ts index ac63e81278..110946dbef 100644 --- a/lib/services/android-device-debug-service.ts +++ b/lib/services/android-device-debug-service.ts @@ -24,7 +24,7 @@ export class AndroidDeviceDebugService extends DebugServiceBase implements IDevi this.deviceIdentifier = device.deviceInfo.identifier; } - public async debug(debugData: IDebugData, debugOptions: IDebugOptions): Promise { + public async debug(debugData: IDebugData, debugOptions: IDebugOptions): Promise { this._packageName = debugData.applicationIdentifier; const result = this.device.isEmulator ? await this.debugOnEmulator(debugData, debugOptions) @@ -59,7 +59,7 @@ export class AndroidDeviceDebugService extends DebugServiceBase implements IDevi return this.removePortForwarding(); } - private async debugOnEmulator(debugData: IDebugData, debugOptions: IDebugOptions): Promise { + private async debugOnEmulator(debugData: IDebugData, debugOptions: IDebugOptions): Promise { // Assure we've detected the emulator as device // For example in case deployOnEmulator had stated new emulator instance // we need some time to detect it. Let's force detection. @@ -97,7 +97,7 @@ export class AndroidDeviceDebugService extends DebugServiceBase implements IDevi return this.device.adb.executeCommand(["forward", `tcp:${local}`, `localabstract:${remote}`]); } - private async debugOnDevice(debugData: IDebugData, debugOptions: IDebugOptions): Promise { + private async debugOnDevice(debugData: IDebugData, debugOptions: IDebugOptions): Promise { let packageFile = ""; if (!debugOptions.start && !this.device.isEmulator) { @@ -113,27 +113,32 @@ export class AndroidDeviceDebugService extends DebugServiceBase implements IDevi projectName }; - const action = (device: Mobile.IAndroidDevice): Promise => this.debugCore(device, packageFile, appData, debugOptions); + const action = (device: Mobile.IAndroidDevice): Promise => this.debugCore(device, packageFile, appData, debugOptions); const deviceActionResult = await this.$devicesService.execute(action, this.getCanExecuteAction(this.deviceIdentifier)); return deviceActionResult[0].result; } - private async debugCore(device: Mobile.IAndroidDevice, packageFile: string, appData: Mobile.IApplicationData, debugOptions: IDebugOptions): Promise { + private async debugCore(device: Mobile.IAndroidDevice, packageFile: string, appData: Mobile.IApplicationData, debugOptions: IDebugOptions): Promise { + const result: IDebugResultInfo = { hasReconnected: false, debugUrl: null }; + if (debugOptions.stop) { await this.removePortForwarding(); - return null; + return result; } if (!debugOptions.start) { await this.debugStartCore(appData, debugOptions); + result.hasReconnected = true; } await this.validateRunningApp(device.deviceInfo.identifier, appData.appId); const debugPort = await this.getForwardedDebugPort(device.deviceInfo.identifier, appData.appId); await this.printDebugPort(device.deviceInfo.identifier, debugPort); - return this.getChromeDebugUrl(debugOptions, debugPort); + result.debugUrl = this.getChromeDebugUrl(debugOptions, debugPort); + + return result; } private async printDebugPort(deviceId: string, port: number): Promise { diff --git a/lib/services/debug-service-base.ts b/lib/services/debug-service-base.ts index 765a2a33ea..230fbb3d78 100644 --- a/lib/services/debug-service-base.ts +++ b/lib/services/debug-service-base.ts @@ -10,7 +10,7 @@ export abstract class DebugServiceBase extends EventEmitter implements IDeviceDe public abstract get platform(): string; - public abstract async debug(debugData: IDebugData, debugOptions: IDebugOptions): Promise; + public abstract async debug(debugData: IDebugData, debugOptions: IDebugOptions): Promise; public abstract async debugStart(debugData: IDebugData, debugOptions: IDebugOptions): Promise; diff --git a/lib/services/debug-service.ts b/lib/services/debug-service.ts index d9ae030dc5..0b5186ca72 100644 --- a/lib/services/debug-service.ts +++ b/lib/services/debug-service.ts @@ -40,12 +40,6 @@ export class DebugService extends EventEmitter implements IDebugService { } const debugOptions: IDebugOptions = _.cloneDeep(options); - - // TODO: Check if app is running. - // For now we can only check if app is running on Android. - // After we find a way to check on iOS we should use it here. - let result: string; - const debugService = this.getDeviceDebugService(device); if (!debugService) { this.$errors.failWithoutHelp(`Unsupported device OS: ${device.deviceInfo.platform}. You can debug your applications only on iOS or Android.`); @@ -62,9 +56,9 @@ export class DebugService extends EventEmitter implements IDebugService { } } - result = await debugService.debug(debugData, debugOptions); + const debugResultInfo = await debugService.debug(debugData, debugOptions); - return this.getDebugInformation(result, device.deviceInfo.identifier); + return this.getDebugInformation(debugResultInfo, device.deviceInfo.identifier); } public debugStop(deviceIdentifier: string): Promise { @@ -100,16 +94,17 @@ export class DebugService extends EventEmitter implements IDebugService { platformDebugService.on(CONNECTION_ERROR_EVENT_NAME, connectionErrorHandler); } - private getDebugInformation(fullUrl: string, deviceIdentifier: string): IDebugInformation { + private getDebugInformation(debugResultInfo: IDebugResultInfo, deviceIdentifier: string): IDebugInformation { const debugInfo: IDebugInformation = { - url: fullUrl, + url: debugResultInfo.debugUrl, port: 0, - deviceIdentifier + deviceIdentifier, + hasReconnected: debugResultInfo.hasReconnected }; - if (fullUrl) { + if (debugResultInfo.debugUrl) { const parseQueryString = true; - const wsQueryParam = parse(fullUrl, parseQueryString).query.ws; + const wsQueryParam = parse(debugResultInfo.debugUrl, parseQueryString).query.ws; const hostPortSplit = wsQueryParam && wsQueryParam.split(":"); debugInfo.port = hostPortSplit && +hostPortSplit[1]; } diff --git a/lib/services/ios-device-debug-service.ts b/lib/services/ios-device-debug-service.ts index fca655f481..88d6b481c9 100644 --- a/lib/services/ios-device-debug-service.ts +++ b/lib/services/ios-device-debug-service.ts @@ -38,7 +38,8 @@ export class IOSDeviceDebugService extends DebugServiceBase implements IDeviceDe return "ios"; } - public async debug(debugData: IDebugData, debugOptions: IDebugOptions): Promise { + public async debug(debugData: IDebugData, debugOptions: IDebugOptions): Promise { + const result: IDebugResultInfo = { hasReconnected: false, debugUrl: null }; this.validateOptions(debugOptions); await this.startDeviceLogProcess(debugData, debugOptions); @@ -46,9 +47,12 @@ export class IOSDeviceDebugService extends DebugServiceBase implements IDeviceDe if (!debugOptions.start) { await this.startApp(debugData, debugOptions); + result.hasReconnected = true; } - return this.wireDebuggerClient(debugData, debugOptions); + result.debugUrl = await this.wireDebuggerClient(debugData, debugOptions); + + return result; } public async debugStart(debugData: IDebugData, debugOptions: IDebugOptions): Promise { diff --git a/lib/services/livesync/android-device-livesync-service.ts b/lib/services/livesync/android-device-livesync-service.ts index 8c3d779d34..07345a146b 100644 --- a/lib/services/livesync/android-device-livesync-service.ts +++ b/lib/services/livesync/android-device-livesync-service.ts @@ -15,7 +15,7 @@ export class AndroidDeviceLiveSyncService extends AndroidDeviceLiveSyncServiceBa protected device: Mobile.IAndroidDevice, $filesHashService: IFilesHashService, $logger: ILogger) { - super($injector, $platformsData, $filesHashService, $logger, device); + super($injector, $platformsData, $filesHashService, $logger, device); } public async transferFilesOnDevice(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[]): Promise { @@ -26,7 +26,8 @@ export class AndroidDeviceLiveSyncService extends AndroidDeviceLiveSyncServiceBa await this.device.fileSystem.transferDirectory(deviceAppData, localToDevicePaths, projectFilesPath); } - public async refreshApplication(projectData: IProjectData, liveSyncInfo: ILiveSyncResultInfo): Promise { + public async refreshApplication(projectData: IProjectData, liveSyncInfo: ILiveSyncResultInfo): Promise { + const result: IRefreshApplicationInfo = { didRestart: false }; const deviceAppData = liveSyncInfo.deviceAppData; const localToDevicePaths = liveSyncInfo.modifiedFilesData; const deviceProjectRootDirname = await this.$devicePathProvider.getDeviceProjectRootPath(liveSyncInfo.deviceAppData.device, { @@ -48,8 +49,11 @@ export class AndroidDeviceLiveSyncService extends AndroidDeviceLiveSyncServiceBa (localToDevicePath: Mobile.ILocalToDevicePathData) => !this.canExecuteFastSync(liveSyncInfo, localToDevicePath.getLocalPath(), projectData, this.device.deviceInfo.platform)); if (!canExecuteFastSync) { - return this.restartApplication(deviceAppData, projectData.projectName); + await this.restartApplication(deviceAppData, projectData.projectName); + result.didRestart = true; } + + return result; } private async cleanLivesyncDirectories(deviceAppData: Mobile.IDeviceAppData): Promise { diff --git a/lib/services/livesync/android-device-livesync-sockets-service.ts b/lib/services/livesync/android-device-livesync-sockets-service.ts index 43cd7f7fd1..4480bf080b 100644 --- a/lib/services/livesync/android-device-livesync-sockets-service.ts +++ b/lib/services/livesync/android-device-livesync-sockets-service.ts @@ -92,7 +92,8 @@ export class AndroidDeviceSocketsLiveSyncService extends AndroidDeviceLiveSyncSe return result; } - public async refreshApplication(projectData: IProjectData, liveSyncInfo: IAndroidLiveSyncResultInfo) { + public async refreshApplication(projectData: IProjectData, liveSyncInfo: IAndroidLiveSyncResultInfo): Promise { + const result: IRefreshApplicationInfo = { didRestart: false }; const canExecuteFastSync = !liveSyncInfo.isFullSync && this.canExecuteFastSyncForPaths(liveSyncInfo, liveSyncInfo.modifiedFilesData, projectData, this.device.deviceInfo.platform); if (!canExecuteFastSync || !liveSyncInfo.didRefresh) { await this.device.applicationManager.restartApplication({ appId: liveSyncInfo.deviceAppData.appIdentifier, projectName: projectData.projectName }); @@ -103,7 +104,11 @@ export class AndroidDeviceSocketsLiveSyncService extends AndroidDeviceLiveSyncSe this.$logger.trace("Failed to connect after app restart."); } } + + result.didRestart = true; } + + return result; } public async removeFiles(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[], projectFilesPath: string): Promise { diff --git a/lib/services/livesync/ios-device-livesync-service.ts b/lib/services/livesync/ios-device-livesync-service.ts index 62e428c15d..03f693f0a9 100644 --- a/lib/services/livesync/ios-device-livesync-service.ts +++ b/lib/services/livesync/ios-device-livesync-service.ts @@ -37,12 +37,14 @@ export class IOSDeviceLiveSyncService extends DeviceLiveSyncServiceBase implemen await Promise.all(_.map(localToDevicePaths, localToDevicePathData => this.device.fileSystem.deleteFile(localToDevicePathData.getDevicePath(), deviceAppData.appIdentifier))); } - public async refreshApplication(projectData: IProjectData, liveSyncInfo: ILiveSyncResultInfo): Promise { + public async refreshApplication(projectData: IProjectData, liveSyncInfo: ILiveSyncResultInfo): Promise { + const result: IRefreshApplicationInfo = { didRestart: false }; const deviceAppData = liveSyncInfo.deviceAppData; const localToDevicePaths = liveSyncInfo.modifiedFilesData; if (liveSyncInfo.isFullSync) { await this.restartApplication(deviceAppData, projectData.projectName); - return; + result.didRestart = true; + return result; } let scriptRelatedFiles: Mobile.ILocalToDevicePathData[] = []; @@ -54,14 +56,18 @@ export class IOSDeviceLiveSyncService extends DeviceLiveSyncServiceBase implemen if (!canExecuteFastSync) { await this.restartApplication(deviceAppData, projectData.projectName); - return; + result.didRestart = true; + return result; } if (await this.setupSocketIfNeeded(projectData)) { await this.reloadPage(otherFiles); } else { await this.restartApplication(deviceAppData, projectData.projectName); + result.didRestart = true; } + + return result; } private async restartApplication(deviceAppData: Mobile.IDeviceAppData, projectName: string): Promise { diff --git a/lib/services/livesync/livesync-service.ts b/lib/services/livesync/livesync-service.ts index 69654a1264..aa2acd793d 100644 --- a/lib/services/livesync/livesync-service.ts +++ b/lib/services/livesync/livesync-service.ts @@ -156,7 +156,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi } } - private async refreshApplication(projectData: IProjectData, liveSyncResultInfo: ILiveSyncResultInfo, debugOpts?: IDebugOptions, outputPath?: string): Promise { + private async refreshApplication(projectData: IProjectData, liveSyncResultInfo: ILiveSyncResultInfo, debugOpts?: IDebugOptions, outputPath?: string): Promise { const deviceDescriptor = this.getDeviceDescriptor(liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier, projectData.projectDir); return deviceDescriptor && deviceDescriptor.debugggingEnabled ? @@ -164,12 +164,13 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi this.refreshApplicationWithoutDebug(projectData, liveSyncResultInfo, debugOpts, outputPath); } - private async refreshApplicationWithoutDebug(projectData: IProjectData, liveSyncResultInfo: ILiveSyncResultInfo, debugOpts?: IDebugOptions, outputPath?: string, settings?: IShouldSkipEmitLiveSyncNotification): Promise { + private async refreshApplicationWithoutDebug(projectData: IProjectData, liveSyncResultInfo: ILiveSyncResultInfo, debugOpts?: IDebugOptions, outputPath?: string, settings?: IShouldSkipEmitLiveSyncNotification): Promise { + let result: IRefreshApplicationInfo = { didRestart: false }; const platform = liveSyncResultInfo.deviceAppData.platform; const platformLiveSyncService = this.getLiveSyncService(platform); const applicationIdentifier = projectData.projectIdentifiers[platform.toLowerCase()]; try { - await platformLiveSyncService.refreshApplication(projectData, liveSyncResultInfo); + result = await platformLiveSyncService.refreshApplication(projectData, liveSyncResultInfo); } catch (err) { this.$logger.info(`Error while trying to start application ${applicationIdentifier} on device ${liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier}. Error is: ${err.message || err}`); const msg = `Unable to start application ${applicationIdentifier} on device ${liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier}. Try starting it manually.`; @@ -193,12 +194,14 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi deviceIdentifier: liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier, isFullSync: liveSyncResultInfo.isFullSync }); + + return result; } private async refreshApplicationWithDebug(projectData: IProjectData, liveSyncResultInfo: ILiveSyncResultInfo, debugOptions: IDebugOptions, outputPath?: string): Promise { + let didRestart = false; const deviceAppData = liveSyncResultInfo.deviceAppData; debugOptions = debugOptions || {}; - const deviceIdentifier = liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier; if (debugOptions.debugBrk) { await this.$debugService.debugStop(deviceIdentifier); @@ -211,13 +214,15 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi this.handleDeveloperDiskImageError(err, liveSyncResultInfo, projectData, debugOptions, outputPath); } } else { - await this.refreshApplicationWithoutDebug(projectData, liveSyncResultInfo, debugOptions, outputPath, { shouldSkipEmitLiveSyncNotification: true }); + const refreshInfo = await this.refreshApplicationWithoutDebug(projectData, liveSyncResultInfo, debugOptions, outputPath, { shouldSkipEmitLiveSyncNotification: true }); + didRestart = refreshInfo.didRestart; } // we do not stop the application when debugBrk is false, so we need to attach, instead of launch // if we try to send the launch request, the debugger port will not be printed and the command will timeout debugOptions.start = !debugOptions.debugBrk; + debugOptions.forceDebuggerAttachedEvent = didRestart; const deviceOption = { deviceIdentifier: liveSyncResultInfo.deviceAppData.device.deviceInfo.identifier, debugOptions: debugOptions, @@ -269,13 +274,17 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi debugData.pathToAppPackage = this.$platformService.lastOutputPath(settings.platform, buildConfig, projectData, settings.outputPath); const debugInfo = await this.$debugService.debug(debugData, settings.debugOptions); - const result = this.printDebugInformation(debugInfo); + const fireDebuggerAttachedEvent = settings.debugOptions.forceDebuggerAttachedEvent || debugInfo.hasReconnected; + const result = this.printDebugInformation(debugInfo, fireDebuggerAttachedEvent); return result; } - public printDebugInformation(debugInformation: IDebugInformation): IDebugInformation { + public printDebugInformation(debugInformation: IDebugInformation, fireDebuggerAttachedEvent: boolean = true): IDebugInformation { if (!!debugInformation.url) { - this.emit(DEBUGGER_ATTACHED_EVENT_NAME, debugInformation); + if (fireDebuggerAttachedEvent) { + this.emit(DEBUGGER_ATTACHED_EVENT_NAME, debugInformation); + } + this.$logger.info(`To start debugging, open the following URL in Chrome:${EOL}${debugInformation.url}${EOL}`.cyan); } diff --git a/lib/services/livesync/platform-livesync-service-base.ts b/lib/services/livesync/platform-livesync-service-base.ts index 5d290f016b..5d1148048c 100644 --- a/lib/services/livesync/platform-livesync-service-base.ts +++ b/lib/services/livesync/platform-livesync-service-base.ts @@ -27,12 +27,16 @@ export abstract class PlatformLiveSyncServiceBase { protected abstract _getDeviceLiveSyncService(device: Mobile.IDevice, data: IProjectData, frameworkVersion: string): INativeScriptDeviceLiveSyncService; - public async refreshApplication(projectData: IProjectData, liveSyncInfo: ILiveSyncResultInfo): Promise { + public async refreshApplication(projectData: IProjectData, liveSyncInfo: ILiveSyncResultInfo): Promise { + let result: IRefreshApplicationInfo = { didRestart: false }; + if (liveSyncInfo.isFullSync || liveSyncInfo.modifiedFilesData.length) { const deviceLiveSyncService = this.getDeviceLiveSyncService(liveSyncInfo.deviceAppData.device, projectData); this.$logger.info(`Refreshing application on device ${liveSyncInfo.deviceAppData.device.deviceInfo.identifier}...`); - await deviceLiveSyncService.refreshApplication(projectData, liveSyncInfo); + result = await deviceLiveSyncService.refreshApplication(projectData, liveSyncInfo); } + + return result; } public async fullSync(syncInfo: IFullSyncInfo): Promise { @@ -87,7 +91,7 @@ export abstract class PlatformLiveSyncServiceBase { const localToDevicePaths = await this.$projectFilesManager.createLocalToDevicePaths(deviceAppData, projectFilesPath, existingFiles, []); modifiedLocalToDevicePaths.push(...localToDevicePaths); - modifiedLocalToDevicePaths = await this.transferFiles(deviceAppData, localToDevicePaths, projectFilesPath, projectData, liveSyncInfo.liveSyncDeviceInfo, { isFullSync: false, force: liveSyncInfo.force}); + modifiedLocalToDevicePaths = await this.transferFiles(deviceAppData, localToDevicePaths, projectFilesPath, projectData, liveSyncInfo.liveSyncDeviceInfo, { isFullSync: false, force: liveSyncInfo.force }); } } diff --git a/test/services/debug-service.ts b/test/services/debug-service.ts index 93d5958203..5991165dcd 100644 --- a/test/services/debug-service.ts +++ b/test/services/debug-service.ts @@ -11,8 +11,8 @@ const fakeChromeDebugUrl = `fakeChromeDebugUrl?experiments=true&ws=localhost:${f const defaultDeviceIdentifier = "Nexus5"; 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 { debugUrl: fakeChromeDebugUrl, hasReconnected: false }; } } @@ -226,7 +226,8 @@ describe("debugService", () => { assert.deepEqual(debugInfo, { url: fakeChromeDebugUrl, port: fakeChromeDebugPort, - deviceIdentifier: debugData.deviceIdentifier + deviceIdentifier: debugData.deviceIdentifier, + hasReconnected: false }); }); }); diff --git a/test/stubs.ts b/test/stubs.ts index 1a47e49c09..28a0ce35f8 100644 --- a/test/stubs.ts +++ b/test/stubs.ts @@ -645,7 +645,7 @@ function unexpected(msg: string): Error { } export class DebugServiceStub extends EventEmitter implements IDeviceDebugService { - public async debug(): Promise { + public async debug(): Promise { return; }