From e4ab344511cd5e1428c186690c5f0f70318f5203 Mon Sep 17 00:00:00 2001 From: Rotem M Date: Mon, 29 Jan 2018 14:37:30 +0200 Subject: [PATCH] Fixes broken AndroidDriver explicit exportGlobals flow. --- detox/src/devices/AndroidDriver.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/detox/src/devices/AndroidDriver.js b/detox/src/devices/AndroidDriver.js index d629f93960..c139a59e07 100644 --- a/detox/src/devices/AndroidDriver.js +++ b/detox/src/devices/AndroidDriver.js @@ -1,5 +1,4 @@ const {spawn} = require('child_process'); -const path = require('path'); const fs = require('fs'); const _ = require('lodash'); const log = require('npmlog'); @@ -15,16 +14,19 @@ const EspressoDetox = 'com.wix.detox.espresso.EspressoDetox'; class AndroidDriver extends DeviceDriverBase { constructor(client) { super(client); - const expect = require('../android/expect'); - expect.exportGlobals(); + this.expect = require('../android/expect'); this.invocationManager = new InvocationManager(client); - expect.setInvocationManager(this.invocationManager); + this.expect.setInvocationManager(this.invocationManager); this.adb = new ADB(); this.aapt = new AAPT(); this.apkPath = new APKPath(); } + exportGlobals() { + this.expect.exportGlobals(); + } + async getBundleIdFromBinary(apkPath) { return await this.aapt.getPackageName(apkPath); }