appium / appium

Cross-platform automation framework for all kinds of apps, built on top of the W3C WebDriver protocol
http://appium.io/
Apache License 2.0
19k stars 6.08k forks source link

bug: Setting _TESTING=1 environment variable causes ReferenceError to MOCK_LOG #20749

Open pathwirejames opened 1 week ago

pathwirejames commented 1 week ago

Do I have the most recent component updates?

Is the component officially supported by the Appium team?

Is there an existing issue for this?

Current Behavior

Attempting to use appium-adb package with the _TESTING environment variable set to 1 causes a JavaScript error: ReferenceError: Cannot access 'MOCK_LOG' before initialization

If _TESTING=1 is left unset, the code works as expected.

Expected Behavior

The call to ADB.createADB() completes without error, and the _TESTING=1 environment variable omits the extra logging output.

Minimal Reproducible Example

https://gist.github.com/pathwirejames/a46d590e78643d926405712441b02ed2

Environment

Link to Appium Logs

https://gist.github.com/pathwirejames/54661e530ab5b97da6b2dd9736861cf5

Further Information

No response

mykola-mokhnach commented 1 week ago

https://github.com/appium/appium/pull/20750 should fix that