From 3a7f0b3fcf1c4a8e48c55a012a426e0991beeca0 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 11 Aug 2020 16:44:35 +0100 Subject: [PATCH] Try any type to fix test --- apps/remix-ide-e2e/src/commands/getAddressAtPosition.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/getAddressAtPosition.ts b/apps/remix-ide-e2e/src/commands/getAddressAtPosition.ts index 40319db14d..f3be936f90 100644 --- a/apps/remix-ide-e2e/src/commands/getAddressAtPosition.ts +++ b/apps/remix-ide-e2e/src/commands/getAddressAtPosition.ts @@ -4,7 +4,7 @@ import EventEmitter from "events" class GetAddressAtPosition extends EventEmitter { command (this: NightwatchBrowser, index: number, cb: (pos: string) => void): NightwatchBrowser { this.api.perform((done) => { - getAddressAtPosition(this.api, index, (pos) => { + getAddressAtPosition(this.api, index, (pos: string) => { done() cb(pos) this.emit('complete') @@ -14,7 +14,7 @@ class GetAddressAtPosition extends EventEmitter { } } -function getAddressAtPosition (browser: NightwatchBrowser, index: number, callback: (pos: string) => void) { +function getAddressAtPosition (browser: NightwatchBrowser, index: number, callback: (pos: any) => void) { browser.waitForElementPresent('*[data-shared="universalDappUiInstance"]') .execute(function (index) { const deployedContracts = document.querySelectorAll('*[data-shared="universalDappUiInstance"]') @@ -22,9 +22,7 @@ function getAddressAtPosition (browser: NightwatchBrowser, index: number, callba return id.replace('instance', '') }, [index], function (result) { - const pos = typeof result.value === 'string' ? result.value : null - - callback(pos) + callback(result.value) }) }