detox 20.1.0 → 20.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/.eslintrc.js +2 -7
  2. package/Detox-android/com/wix/detox/{20.1.0/detox-20.1.0-javadoc.jar → 20.1.1/detox-20.1.1-javadoc.jar} +0 -0
  3. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-javadoc.jar.md5 +1 -0
  4. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-javadoc.jar.sha1 +1 -0
  5. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-javadoc.jar.sha256 +1 -0
  6. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-javadoc.jar.sha512 +1 -0
  7. package/Detox-android/com/wix/detox/{20.1.0/detox-20.1.0-sources.jar → 20.1.1/detox-20.1.1-sources.jar} +0 -0
  8. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-sources.jar.md5 +1 -0
  9. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-sources.jar.sha1 +1 -0
  10. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-sources.jar.sha256 +1 -0
  11. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1-sources.jar.sha512 +1 -0
  12. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.aar +0 -0
  13. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.aar.md5 +1 -0
  14. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.aar.sha1 +1 -0
  15. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.aar.sha256 +1 -0
  16. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.aar.sha512 +1 -0
  17. package/Detox-android/com/wix/detox/{20.1.0/detox-20.1.0.pom → 20.1.1/detox-20.1.1.pom} +1 -1
  18. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.pom.md5 +1 -0
  19. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.pom.sha1 +1 -0
  20. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.pom.sha256 +1 -0
  21. package/Detox-android/com/wix/detox/20.1.1/detox-20.1.1.pom.sha512 +1 -0
  22. package/Detox-android/com/wix/detox/maven-metadata.xml +4 -4
  23. package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +1 -1
  24. package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +1 -1
  25. package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +1 -1
  26. package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +1 -1
  27. package/Detox-ios-src.tbz +0 -0
  28. package/Detox-ios.tbz +0 -0
  29. package/android/detox/src/full/java/com/wix/detox/espresso/idlingresources/DescriptiveIdlingResource.kt +1 -1
  30. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/AsyncStorageIdlingResource.kt +1 -0
  31. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/BridgeIdlingResource.java +6 -6
  32. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/timers/TimersIdlingResource.kt +1 -0
  33. package/index.js +12 -1
  34. package/internals.js +10 -3
  35. package/package.json +15 -3
  36. package/src/DetoxWorker.js +1 -1
  37. package/src/android/core/NativeMatcher.js +14 -10
  38. package/src/android/espressoapi/EspressoDetox.js +1 -1
  39. package/src/android/espressoapi/web/WebElement.js +1 -1
  40. package/src/android/matchers/native.js +1 -2
  41. package/src/artifacts/templates/plugin/ArtifactPlugin.js +1 -1
  42. package/src/artifacts/templates/plugin/TwoSnapshotsPerTestPlugin.js +2 -1
  43. package/src/artifacts/templates/plugin/WholeTestRecorderPlugin.js +3 -2
  44. package/src/client/AsyncWebSocket.js +3 -2
  45. package/src/configuration/collectCliConfig.js +1 -1
  46. package/src/configuration/composeLoggerConfig.js +1 -0
  47. package/src/devices/allocation/drivers/AllocationDriverBase.js +4 -2
  48. package/src/devices/allocation/factories/base.js +1 -1
  49. package/src/devices/common/drivers/android/tools/AppInstallHelper.js +4 -4
  50. package/src/devices/common/drivers/android/tools/{FileXfer.js → FileTransfer.js} +2 -2
  51. package/src/devices/common/drivers/android/tools/TempFileTransfer.js +14 -0
  52. package/src/devices/lifecycle/GenyGlobalLifecycleHandler.js +0 -2
  53. package/src/devices/runtime/drivers/android/AndroidDriver.js +7 -6
  54. package/src/devices/runtime/factories/android.js +6 -5
  55. package/src/devices/runtime/factories/base.js +3 -2
  56. package/src/ios/expectTwo.js +19 -11
  57. package/src/logger/DetoxLogger.js +5 -5
  58. package/src/logger/utils/BunyanLogger.js +5 -4
  59. package/src/realms/DetoxContext.js +5 -2
  60. package/src/realms/DetoxInternalsFacade.js +1 -1
  61. package/src/realms/DetoxPrimaryContext.js +2 -2
  62. package/src/realms/DetoxSecondaryContext.js +1 -1
  63. package/src/{symbols.js → realms/symbols.js} +0 -0
  64. package/src/servicelocator/android/index.js +2 -2
  65. package/src/utils/ExclusiveLockfile.js +1 -0
  66. package/src/utils/argparse.js +0 -27
  67. package/Detox-android/com/wix/detox/20.1.0/detox-20.1.0-javadoc.jar.md5 +0 -1
  68. package/Detox-android/com/wix/detox/20.1.0/detox-20.1.0-javadoc.jar.sha1 +0 -1
  69. package/Detox-android/com/wix/detox/20.1.0/detox-20.1.0-javadoc.jar.sha256 +0 -1
  70. package/Detox-android/com/wix/detox/20.1.0/detox-20.1.0-javadoc.jar.sha512 +0 -1
  71. package/Detox-android/com/wix/detox/20.1.0/detox-20.1.0-sources.jar.md5 +0 -1
  72. package/Detox-android/com/wix/detox/20.1.0/detox-20.1.0-sources.jar.sha1 +0 -1
  73. package/Detox-android/com/wix/detox/20.1.0/detox-20.1.0-sources.jar.sha256 +0 -1
  74. package/Detox-android/com/wix/detox/20.1.0/detox-20.1.0-sources.jar.sha512 +0 -1
  75. package/Detox-android/com/wix/detox/20.1.0/detox-20.1.0.aar +0 -0
  76. package/Detox-android/com/wix/detox/20.1.0/detox-20.1.0.aar.md5 +0 -1
  77. package/Detox-android/com/wix/detox/20.1.0/detox-20.1.0.aar.sha1 +0 -1
  78. package/Detox-android/com/wix/detox/20.1.0/detox-20.1.0.aar.sha256 +0 -1
  79. package/Detox-android/com/wix/detox/20.1.0/detox-20.1.0.aar.sha512 +0 -1
  80. package/Detox-android/com/wix/detox/20.1.0/detox-20.1.0.pom.md5 +0 -1
  81. package/Detox-android/com/wix/detox/20.1.0/detox-20.1.0.pom.sha1 +0 -1
  82. package/Detox-android/com/wix/detox/20.1.0/detox-20.1.0.pom.sha256 +0 -1
  83. package/Detox-android/com/wix/detox/20.1.0/detox-20.1.0.pom.sha512 +0 -1
  84. package/src/devices/common/drivers/android/tools/TempFileXfer.js +0 -16
  85. package/src/realms/index.js +0 -10
package/.eslintrc.js CHANGED
@@ -17,7 +17,7 @@ module.exports = {
17
17
  node: true
18
18
  },
19
19
  globals: {
20
- 'callCli': true,
20
+ // TODO: remove use of fail() across the project because Jest Circus doesn't support it
21
21
  'fail': true
22
22
  },
23
23
  rules: {
@@ -54,12 +54,7 @@ module.exports = {
54
54
  }
55
55
  ],
56
56
  'no-prototype-builtins': 'off',
57
- 'no-unused-vars': [
58
- 'error',
59
- {
60
- 'argsIgnorePattern': '^_'
61
- }
62
- ],
57
+ 'no-unused-vars': 'off',
63
58
  'node/no-unpublished-require': 'warn',
64
59
  'object-curly-spacing': [
65
60
  'error',
@@ -0,0 +1 @@
1
+ 3533d80394c8bfe48da303ca68dd1f89
@@ -0,0 +1 @@
1
+ 4113dbb267c11ac42088bc269e86cde5bc6db556
@@ -0,0 +1 @@
1
+ 13c9c7d4904c88e394d57285cad46a9ceeb93e89341c6cc8b2367fcf89f05a1c
@@ -0,0 +1 @@
1
+ 1bba8a54331fb99a135bb5fa6230c06ac1eeee49a1c82457ab4a93d556dabecb82562fc4ed28890a2482aa23bb2abd29c5f1c7a67053161a2d45c6258493021d
@@ -0,0 +1 @@
1
+ 4457ab21cced7cb4abc14a3a1bfd382e
@@ -0,0 +1 @@
1
+ 06d2b66f9a4f83667da69bc232a41d9a9be65dae
@@ -0,0 +1 @@
1
+ 8c600ab5f63651b72eb24f709a3cd1c4a854b7aeb698edf3df4ee4ba8b62faef
@@ -0,0 +1 @@
1
+ 475b2e2805f4056469824ab7c0ba5ac1f149eea95d4a19f19e49d448151644db5d813d627f230a95d26f23e727c8c54205ab8da7e6c8e99f8284d6e4b11c8642
@@ -0,0 +1 @@
1
+ c7eb63b23e9fec3154e5402cc0f65283
@@ -0,0 +1 @@
1
+ 16bed62cec4774262c71a7daad13efcdac3c7942
@@ -0,0 +1 @@
1
+ c12164b0a26a6db45c65d984af4c2a880e2bf5d516ceb582361576eff713e378
@@ -0,0 +1 @@
1
+ d50db96253552903c6acf2328ff2baa9788aac5846622bc01c4c9e6026738991f6eea1ea2723afe21ffdec692a3caeadb39b6ac5cfb31bf40c7d184e058701bb
@@ -3,7 +3,7 @@
3
3
  <modelVersion>4.0.0</modelVersion>
4
4
  <groupId>com.wix</groupId>
5
5
  <artifactId>detox</artifactId>
6
- <version>20.1.0</version>
6
+ <version>20.1.1</version>
7
7
  <packaging>aar</packaging>
8
8
  <name>Detox</name>
9
9
  <description>Gray box end-to-end testing and automation library for mobile apps</description>
@@ -0,0 +1 @@
1
+ 206c05d36b87423370c11d774d657d2c
@@ -0,0 +1 @@
1
+ 7d21c64abcb385dc4abad4710aa28a07bc0a0139
@@ -0,0 +1 @@
1
+ 621bb24a95f5b035a6a3aa83f7a8539f65b8bef7dad040decef5baf855989303
@@ -0,0 +1 @@
1
+ 8501704d10d93054cc9707fac37e85433003e6922dbc35e44011bf43660c402871c2fd830c6ad699e7ac455dbf780650ab34726c8548b9e495dcfbadb6b470a2
@@ -3,11 +3,11 @@
3
3
  <groupId>com.wix</groupId>
4
4
  <artifactId>detox</artifactId>
5
5
  <versioning>
6
- <latest>20.1.0</latest>
7
- <release>20.1.0</release>
6
+ <latest>20.1.1</latest>
7
+ <release>20.1.1</release>
8
8
  <versions>
9
- <version>20.1.0</version>
9
+ <version>20.1.1</version>
10
10
  </versions>
11
- <lastUpdated>20221212153534</lastUpdated>
11
+ <lastUpdated>20221228155305</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- b02bbab8a120f411b8c9e07c75d6c54b
1
+ 34496b51530e21c8da62be3f7ae4ea68
@@ -1 +1 @@
1
- 2e0d0ea05c62fd6d2bbe0cdb43a2efb6315e8c29
1
+ c9ac4db5ef1c06124081c598f688aad051cf8ac1
@@ -1 +1 @@
1
- 6bd3e259aefe68a101c55de5de010ad3a84cc3f30116c87cf35a668264329310
1
+ 800f040e828f15c49d2189d6c80f99c3433ceabb063f87413b60eaeb17e5a48d
@@ -1 +1 @@
1
- c14e8fe0813c1b8f97b59b54f76c28fe1d1b3293908d5226b2c584a902a7a247c5fcc33aad5295b13729b83c415f29699da133dc9127d138f3be5f0be3ddff8b
1
+ 696664270a4a6893fdb1193f79851a049a08294a5f16c0696ecc40999543eff16367c6bd1aebad62305820ecf447056a620fc65f45aa4aca6f33914cb78680b4
package/Detox-ios-src.tbz CHANGED
Binary file
package/Detox-ios.tbz CHANGED
Binary file
@@ -4,5 +4,5 @@ import androidx.test.espresso.IdlingResource
4
4
 
5
5
  interface DescriptiveIdlingResource: IdlingResource {
6
6
  fun getDebugName(): String
7
- fun getBusyHint(): Map<String, Any>? = null
7
+ fun getBusyHint(): Map<String, Any>?
8
8
  }
@@ -52,6 +52,7 @@ open class AsyncStorageIdlingResource
52
52
 
53
53
  override fun getName(): String = javaClass.name
54
54
  override fun getDebugName() = "io"
55
+ override fun getBusyHint(): Map<String, Any>? = null
55
56
 
56
57
  override fun isIdleNow(): Boolean =
57
58
  checkIdle().also { idle ->
@@ -48,6 +48,12 @@ public class BridgeIdlingResource extends DetoxBaseIdlingResource implements Not
48
48
  return "bridge";
49
49
  }
50
50
 
51
+ @Nullable
52
+ @Override
53
+ public Map<String, Object> getBusyHint() {
54
+ return null;
55
+ }
56
+
51
57
  @Override
52
58
  protected boolean checkIdle() {
53
59
  boolean ret = idleNow.get();
@@ -85,10 +91,4 @@ public class BridgeIdlingResource extends DetoxBaseIdlingResource implements Not
85
91
  callback.onTransitionToIdle();
86
92
  }
87
93
  }
88
-
89
- @Nullable
90
- @Override
91
- public Map<String, Object> getBusyHint() {
92
- return null;
93
- }
94
94
  }
@@ -13,6 +13,7 @@ class TimersIdlingResource @JvmOverloads constructor(
13
13
 
14
14
  override fun getName(): String = this.javaClass.name
15
15
  override fun getDebugName(): String = "timers"
16
+ override fun getBusyHint(): Map<String, Any>? = null
16
17
 
17
18
  override fun registerIdleTransitionCallback(callback: IdlingResource.ResourceCallback?) {
18
19
  this.callback = callback
package/index.js CHANGED
@@ -1 +1,12 @@
1
- module.exports = require('./src/realms');
1
+ function create() {
2
+ if (process.env.DETOX_CONFIG_SNAPSHOT_PATH) {
3
+ return require('./src/realms/secondary');
4
+ } else {
5
+ return require('./src/realms/primary');
6
+ }
7
+ }
8
+
9
+ /** @type {Detox.DetoxExportWrapper} */
10
+ module.exports = global['__detox__']
11
+ ? global['__detox__'].clientApi
12
+ : create();
package/internals.js CHANGED
@@ -1,4 +1,11 @@
1
- const realm = require('./src/realms');
2
- const DetoxInternalsFacade = require('./src/realms/DetoxInternalsFacade');
1
+ function create() {
2
+ const context = require('./index');
3
+ const DetoxInternalsFacade = require('./src/realms/DetoxInternalsFacade');
3
4
 
4
- module.exports = new DetoxInternalsFacade(realm);
5
+ return new DetoxInternalsFacade(context);
6
+ }
7
+
8
+ /** @type {DetoxInternals.Facade} */
9
+ module.exports = global['__detox__']
10
+ ? global['__detox__'].internalsApi
11
+ : create();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "detox",
3
3
  "description": "E2E tests and automation for mobile",
4
- "version": "20.1.0",
4
+ "version": "20.1.1",
5
5
  "bin": {
6
6
  "detox": "local-cli/cli.js"
7
7
  },
@@ -41,12 +41,14 @@
41
41
  "@types/ws": "^7.4.0",
42
42
  "@typescript-eslint/eslint-plugin": "^5.4.0",
43
43
  "@typescript-eslint/parser": "^5.4.0",
44
+ "cross-env": "^7.0.3",
44
45
  "eslint": "^8.3.0",
45
46
  "eslint-plugin-import": "^2.23.3",
46
47
  "eslint-plugin-no-only-tests": "^2.6.0",
47
48
  "eslint-plugin-node": "^11.1.0",
48
49
  "eslint-plugin-unicorn": "^39.0.0",
49
50
  "jest": "^28.1.3",
51
+ "jest-allure2-reporter": "^1.2.1",
50
52
  "mockdate": "^2.0.1",
51
53
  "prettier": "1.7.0",
52
54
  "react-native": "0.69.7",
@@ -68,7 +70,6 @@
68
70
  "ini": "^1.3.4",
69
71
  "json-cycle": "^1.3.0",
70
72
  "lodash": "^4.17.5",
71
- "minimist": "^1.2.0",
72
73
  "multi-sort-stream": "^1.0.3",
73
74
  "multipipe": "^4.0.0",
74
75
  "node-ipc": "^9.2.1",
@@ -122,6 +123,8 @@
122
123
  "__tests__",
123
124
  ".test.js$",
124
125
  ".mock.js$",
126
+ "index.js",
127
+ "internals.js",
125
128
  "local-cli/utils",
126
129
  "src/environmentFactory",
127
130
  "src/android/espressoapi",
@@ -166,6 +169,15 @@
166
169
  ],
167
170
  "resetMocks": true,
168
171
  "resetModules": true,
172
+ "reporters": [
173
+ "default",
174
+ [
175
+ "jest-allure2-reporter",
176
+ {
177
+ "getEnvironmentInfo": false
178
+ }
179
+ ]
180
+ ],
169
181
  "coverageReporters": [
170
182
  "html",
171
183
  "json",
@@ -187,5 +199,5 @@
187
199
  }
188
200
  }
189
201
  },
190
- "gitHead": "57097c7301cae2460bd3b36c1749c4048d84dd39"
202
+ "gitHead": "c0135e1a0ce091318cc34b7f162157fbe73b11ab"
191
203
  }
@@ -5,7 +5,7 @@ const Client = require('./client/Client');
5
5
  const environmentFactory = require('./environmentFactory');
6
6
  const { DetoxRuntimeErrorComposer } = require('./errors');
7
7
  const { InvocationManager } = require('./invoke');
8
- const symbols = require('./symbols');
8
+ const symbols = require('./realms/symbols');
9
9
  const AsyncEmitter = require('./utils/AsyncEmitter');
10
10
  const uuid = require('./utils/uuid');
11
11
 
@@ -2,29 +2,33 @@ const invoke = require('../../invoke');
2
2
  const DetoxMatcherApi = require('../espressoapi/DetoxMatcher');
3
3
 
4
4
  class NativeMatcher {
5
+ constructor(call) {
6
+ this._call = call || null;
7
+ }
8
+
5
9
  withAncestor(matcher) {
6
- this._call = invoke.callDirectly(DetoxMatcherApi.matcherWithAncestor(this, matcher));
7
- return this;
10
+ const call = invoke.callDirectly(DetoxMatcherApi.matcherWithAncestor(this, matcher));
11
+ return new NativeMatcher(call);
8
12
  }
9
13
 
10
14
  withDescendant(matcher) {
11
- this._call = invoke.callDirectly(DetoxMatcherApi.matcherWithDescendant(this, matcher));
12
- return this;
15
+ const call = invoke.callDirectly(DetoxMatcherApi.matcherWithDescendant(this, matcher));
16
+ return new NativeMatcher(call);
13
17
  }
14
18
 
15
19
  and(matcher) {
16
- this._call = invoke.callDirectly(DetoxMatcherApi.matcherForAnd(this, matcher));
17
- return this;
20
+ const call = invoke.callDirectly(DetoxMatcherApi.matcherForAnd(this, matcher));
21
+ return new NativeMatcher(call);
18
22
  }
19
23
 
20
24
  or(matcher) {
21
- this._call = invoke.callDirectly(DetoxMatcherApi.matcherForOr(this, matcher));
22
- return this;
25
+ const call = invoke.callDirectly(DetoxMatcherApi.matcherForOr(this, matcher));
26
+ return new NativeMatcher(call);
23
27
  }
24
28
 
25
29
  get not() {
26
- this._call = invoke.callDirectly(DetoxMatcherApi.matcherForNot(this));
27
- return this;
30
+ const call = invoke.callDirectly(DetoxMatcherApi.matcherForNot(this));
31
+ return new NativeMatcher(call);
28
32
  }
29
33
 
30
34
  _avoidProblematicReactNativeElements() {
@@ -52,7 +52,7 @@ class EspressoDetox {
52
52
  }
53
53
 
54
54
  static setURLBlacklist(urls) {
55
- if (typeof urls !== 'object' || !urls instanceof Array) {
55
+ if (typeof urls !== 'object' || !Array.isArray(urls)) {
56
56
  throw new Error('urls must be an array, got ' + typeof urls);
57
57
  }
58
58
 
@@ -69,7 +69,7 @@ class WebElement {
69
69
  static runScriptWithArgs(element, script, args) {
70
70
  if (typeof script !== "string") throw new Error("script should be a string, but got " + (script + (" (" + (typeof script + ")"))));
71
71
 
72
- if (typeof args !== 'object' || !args instanceof Array) {
72
+ if (typeof args !== 'object' || !Array.isArray(args)) {
73
73
  throw new Error('args must be an array, got ' + typeof args);
74
74
  }
75
75
 
@@ -64,8 +64,7 @@ class ToggleMatcher extends NativeMatcher {
64
64
  }
65
65
  }
66
66
 
67
- // TODO
68
- // Please be aware, that this is just a dummy matcher
67
+ // TODO: Please be aware, that this is just a dummy matcher
69
68
  class TraitsMatcher extends NativeMatcher {
70
69
  constructor(value) {
71
70
  super();
@@ -1,5 +1,5 @@
1
+ /* eslint @typescript-eslint/no-unused-vars: ["error", { "args": "none" }] */
1
2
  // @ts-nocheck
2
- /* eslint-disable no-unused-vars */
3
3
 
4
4
  const _ = require('lodash');
5
5
 
@@ -1,3 +1,4 @@
1
+ /* eslint @typescript-eslint/no-unused-vars: ["error", { "args": "none" }] */
1
2
  // @ts-nocheck
2
3
  const DetoxRuntimeError = require('../../../errors/DetoxRuntimeError');
3
4
 
@@ -85,7 +86,7 @@ class TwoSnapshotsPerTestPlugin extends ArtifactPlugin {
85
86
  * @protected
86
87
  * @abstract
87
88
  */
88
- async preparePathForSnapshot(testSummary, snapshotName) {} // eslint-disable-line no-unused-vars
89
+ async preparePathForSnapshot(testSummary, snapshotName) {}
89
90
 
90
91
  /***
91
92
  * Creates a handle for a test artifact (video recording, log, etc.)
@@ -1,4 +1,4 @@
1
- // @ts-nocheck
1
+ /* eslint @typescript-eslint/no-unused-vars: ["error", { "args": "none" }] */
2
2
  const ArtifactPlugin = require('./ArtifactPlugin');
3
3
 
4
4
  /***
@@ -8,6 +8,7 @@ class WholeTestRecorderPlugin extends ArtifactPlugin {
8
8
  constructor({ api }) {
9
9
  super({ api });
10
10
 
11
+ /** @type {*} */
11
12
  this.testRecording = null;
12
13
  }
13
14
 
@@ -51,7 +52,7 @@ class WholeTestRecorderPlugin extends ArtifactPlugin {
51
52
  * @abstract
52
53
  * @protected
53
54
  */
54
- createTestRecording() {}
55
+ createTestRecording(config) {}
55
56
 
56
57
  /***
57
58
  * @abstract
@@ -1,3 +1,4 @@
1
+ /* eslint @typescript-eslint/no-unused-vars: ["error", { "args": "none" }] */
1
2
  // @ts-nocheck
2
3
  const _ = require('lodash');
3
4
  const WebSocket = require('ws');
@@ -176,7 +177,7 @@ class AsyncWebSocket {
176
177
  * @param {WebSocket.OpenEvent} event
177
178
  * @private
178
179
  */
179
- _onOpen(event) { // eslint-disable-line no-unused-vars
180
+ _onOpen(event) {
180
181
  log.trace(`opened web socket to: ${this._url}`);
181
182
  this._opening.resolve();
182
183
  this._opening = null;
@@ -268,7 +269,7 @@ class AsyncWebSocket {
268
269
  * @param {WebSocket.CloseEvent | null} event
269
270
  * @private
270
271
  */
271
- _onClose(event) { // eslint-disable-line no-unused-vars
272
+ _onClose(event) {
272
273
  if (this._closing) {
273
274
  this._closing.resolve();
274
275
  }
@@ -23,7 +23,7 @@ const asNumber = (value) => {
23
23
  };
24
24
 
25
25
  function collectCliConfig({ argv }) {
26
- const env = (key) => argparse.getArgValue(key);
26
+ const env = (key) => argparse.getEnvValue(key);
27
27
  const get = (key, fallback) => {
28
28
  const value = argv && Reflect.has(argv, key) ? argv[key] : env(key);
29
29
  return value === undefined ? fallback : value;
@@ -1,3 +1,4 @@
1
+ /* eslint @typescript-eslint/no-unused-vars: ["error", { "args": "none" }] */
1
2
  const _ = require('lodash');
2
3
 
3
4
  const { castLevel, defaultOptions } = require('../logger/DetoxLogger');
@@ -1,4 +1,6 @@
1
+ /* eslint @typescript-eslint/no-unused-vars: ["error", { "args": "none" }] */
1
2
  // @ts-nocheck
3
+
2
4
  /**
3
5
  * @typedef DeallocOptions
4
6
  * @property shutdown { Boolean }
@@ -9,14 +11,14 @@ class AllocationDriverBase {
9
11
  * @param deviceConfig { Object }
10
12
  * @return {Promise<DeviceCookie>}
11
13
  */
12
- async allocate(deviceConfig) {} // eslint-disable-line no-unused-vars
14
+ async allocate(deviceConfig) {}
13
15
 
14
16
  /**
15
17
  * @param cookie { DeviceCookie }
16
18
  * @param options { DeallocOptions }
17
19
  * @return {Promise<void>}
18
20
  */
19
- async free(cookie, options) {} // eslint-disable-line no-unused-vars
21
+ async free(cookie, options) {}
20
22
  }
21
23
 
22
24
  module.exports = AllocationDriverBase;
@@ -16,7 +16,7 @@ class DeviceAllocatorFactory {
16
16
  * @returns { AllocationDriverBase }
17
17
  * @private
18
18
  */
19
- _createDriver(deps) {} // eslint-disable-line no-unused-vars
19
+ _createDriver(deps) {} // eslint-disable-line @typescript-eslint/no-unused-vars
20
20
  }
21
21
 
22
22
  module.exports = DeviceAllocatorFactory;
@@ -1,13 +1,13 @@
1
1
  // TODO Tweak such that if apk's already exist on the device (need to store uniquely), they will not be resent (would optimize cloud, for example)
2
2
 
3
3
  class AppInstallHelper {
4
- constructor(adb, fileXfer) {
4
+ constructor(adb, fileTransfer) {
5
5
  this._adb = adb;
6
- this._fileXfer = fileXfer;
6
+ this._fileTransfer = fileTransfer;
7
7
  }
8
8
 
9
9
  async install(deviceId, appBinaryPath, testBinaryPath) {
10
- await this._fileXfer.prepareDestinationDir(deviceId);
10
+ await this._fileTransfer.prepareDestinationDir(deviceId);
11
11
  await this._pushAndInstallBinary(deviceId, appBinaryPath, 'Application.apk');
12
12
  if (testBinaryPath) {
13
13
  await this._pushAndInstallBinary(deviceId, testBinaryPath, 'Test.apk');
@@ -15,7 +15,7 @@ class AppInstallHelper {
15
15
  }
16
16
 
17
17
  async _pushAndInstallBinary(deviceId, binaryPath, binaryFilenameOnTarget) {
18
- const binaryPathOnTarget = await this._fileXfer.send(deviceId, binaryPath, binaryFilenameOnTarget);
18
+ const binaryPathOnTarget = await this._fileTransfer.send(deviceId, binaryPath, binaryFilenameOnTarget);
19
19
  await this._adb.remoteInstall(deviceId, binaryPathOnTarget);
20
20
  }
21
21
  }
@@ -1,6 +1,6 @@
1
1
  const path = require('path');
2
2
 
3
- class FileXfer {
3
+ class FileTransfer {
4
4
  constructor(adb, destinationDir) {
5
5
  this._adb = adb;
6
6
  this._dir = destinationDir;
@@ -18,4 +18,4 @@ class FileXfer {
18
18
  }
19
19
  }
20
20
 
21
- module.exports = FileXfer;
21
+ module.exports = FileTransfer;
@@ -0,0 +1,14 @@
1
+ const FileTransfer = require('./FileTransfer');
2
+
3
+ const FILE_PATH = '/data/local/tmp/detox';
4
+
5
+ class TempFileTransfer extends FileTransfer {
6
+ constructor(adb) {
7
+ super(adb, FILE_PATH);
8
+ }
9
+ }
10
+
11
+ module.exports = {
12
+ TempFileTransfer,
13
+ FILE_PATH
14
+ };
@@ -12,8 +12,6 @@ class GenyGlobalLifecycleHandler {
12
12
  this._instanceLifecycleService = instanceLifecycleService;
13
13
  }
14
14
 
15
- // TODO: remove this ignore as soon as DetoxPrimaryContext is covered with tests
16
- /* istanbul ignore next */
17
15
  async globalInit() {}
18
16
 
19
17
  emergencyCleanup() {
@@ -1,3 +1,4 @@
1
+ /* eslint @typescript-eslint/no-unused-vars: ["error", { "args": "none" }] */
1
2
  // @ts-nocheck
2
3
  const path = require('path');
3
4
  const URL = require('url').URL;
@@ -31,7 +32,7 @@ const log = logger.child({ cat: 'device' });
31
32
  * @property adb { ADB }
32
33
  * @property aapt { AAPT }
33
34
  * @property apkValidator { ApkValidator }
34
- * @property fileXfer { FileXfer }
35
+ * @property fileTransfer { FileTransfer }
35
36
  * @property appInstallHelper { AppInstallHelper }
36
37
  * @property appUninstallHelper { AppUninstallHelper }
37
38
  * @property devicePathBuilder { AndroidDevicePathBuilder }
@@ -51,7 +52,7 @@ class AndroidDriver extends DeviceDriverBase {
51
52
  this.aapt = deps.aapt;
52
53
  this.apkValidator = deps.apkValidator;
53
54
  this.invocationManager = deps.invocationManager;
54
- this.fileXfer = deps.fileXfer;
55
+ this.fileTransfer = deps.fileTransfer;
55
56
  this.appInstallHelper = deps.appInstallHelper;
56
57
  this.appUninstallHelper = deps.appUninstallHelper;
57
58
  this.devicePathBuilder = deps.devicePathBuilder;
@@ -162,11 +163,11 @@ class AndroidDriver extends DeviceDriverBase {
162
163
  }
163
164
  }
164
165
 
165
- async pressBack() { // eslint-disable-line no-unused-vars
166
+ async pressBack() {
166
167
  await this.uiDevice.pressBack();
167
168
  }
168
169
 
169
- async sendToHome(params) { // eslint-disable-line no-unused-vars
170
+ async sendToHome(params) {
170
171
  await this.uiDevice.pressHome();
171
172
  }
172
173
 
@@ -331,8 +332,8 @@ class AndroidDriver extends DeviceDriverBase {
331
332
  }
332
333
 
333
334
  async _sendNotificationDataToDevice(dataFileLocalPath, adbName) {
334
- await this.fileXfer.prepareDestinationDir(adbName);
335
- return await this.fileXfer.send(adbName, dataFileLocalPath, 'notification.json');
335
+ await this.fileTransfer.prepareDestinationDir(adbName);
336
+ return await this.fileTransfer.send(adbName, dataFileLocalPath, 'notification.json');
336
337
  }
337
338
 
338
339
  _startActivityWithUrl(url) {
@@ -1,3 +1,4 @@
1
+ /* eslint @typescript-eslint/no-unused-vars: ["error", { "args": "none" }] */
1
2
  const RuntimeDeviceFactory = require('./base');
2
3
 
3
4
  class RuntimeDriverFactoryAndroid extends RuntimeDeviceFactory {
@@ -6,7 +7,7 @@ class RuntimeDriverFactoryAndroid extends RuntimeDeviceFactory {
6
7
  const adb = serviceLocator.adb;
7
8
  const aapt = serviceLocator.aapt;
8
9
  const apkValidator = serviceLocator.apkValidator;
9
- const fileXfer = serviceLocator.fileXfer;
10
+ const fileTransfer = serviceLocator.fileTransfer;
10
11
  const devicePathBuilder = serviceLocator.devicePathBuilder;
11
12
 
12
13
  const AppInstallHelper = require('../../common/drivers/android/tools/AppInstallHelper');
@@ -18,9 +19,9 @@ class RuntimeDriverFactoryAndroid extends RuntimeDeviceFactory {
18
19
  adb,
19
20
  aapt,
20
21
  apkValidator,
21
- fileXfer,
22
+ fileTransfer,
22
23
  devicePathBuilder,
23
- appInstallHelper: new AppInstallHelper(adb, fileXfer),
24
+ appInstallHelper: new AppInstallHelper(adb, fileTransfer),
24
25
  appUninstallHelper: new AppUninstallHelper(adb),
25
26
  instrumentation: new MonitoredInstrumentation(adb),
26
27
  };
@@ -41,7 +42,7 @@ class AndroidEmulator extends RuntimeDriverFactoryAndroid {
41
42
  }
42
43
 
43
44
  class AndroidAttached extends RuntimeDriverFactoryAndroid {
44
- _createDriver(deviceCookie, deps, configs) { // eslint-disable-line no-unused-vars
45
+ _createDriver(deviceCookie, deps, configs) {
45
46
  const props = {
46
47
  adbName: deviceCookie.adbName,
47
48
  };
@@ -52,7 +53,7 @@ class AndroidAttached extends RuntimeDriverFactoryAndroid {
52
53
  }
53
54
 
54
55
  class Genycloud extends RuntimeDriverFactoryAndroid {
55
- _createDriver(deviceCookie, deps, configs) { // eslint-disable-line no-unused-vars
56
+ _createDriver(deviceCookie, deps, configs) {
56
57
  const props = {
57
58
  instance: deviceCookie.instance,
58
59
  };
@@ -1,3 +1,4 @@
1
+ /* eslint @typescript-eslint/no-unused-vars: ["error", { "args": "none" }] */
1
2
  const RuntimeDevice = require('../RuntimeDevice');
2
3
 
3
4
  class RuntimeDeviceFactory {
@@ -7,8 +8,8 @@ class RuntimeDeviceFactory {
7
8
  return new RuntimeDevice({ ...commonDeps, ...configs }, runtimeDriver);
8
9
  }
9
10
 
10
- _createDriverDependencies(commonDeps) { } // eslint-disable-line no-unused-vars
11
- _createDriver(deviceCookie, deps, configs) {} // eslint-disable-line no-unused-vars
11
+ _createDriverDependencies(commonDeps) { }
12
+ _createDriver(deviceCookie, deps, configs) {}
12
13
  }
13
14
 
14
15
  module.exports = RuntimeDeviceFactory;
@@ -438,8 +438,7 @@ class Matcher {
438
438
  throwMatcherError(matcher);
439
439
  }
440
440
 
441
- this.and({ predicate: { type: 'ancestor', predicate: matcher.predicate } });
442
- return this;
441
+ return this.and({ predicate: { type: 'ancestor', predicate: matcher.predicate } });
443
442
  }
444
443
 
445
444
  withDescendant(matcher) {
@@ -447,21 +446,30 @@ class Matcher {
447
446
  throwMatcherError(matcher);
448
447
  }
449
448
 
450
- this.and({ predicate: { type: 'descendant', predicate: matcher.predicate } });
451
- return this;
449
+ return this.and({ predicate: { type: 'descendant', predicate: matcher.predicate } });
452
450
  }
453
451
 
454
452
  and(matcher) {
455
- const tempPredicate = this.predicate;
456
- delete this.predicate;
457
- this.predicate = { type: 'and', predicates: [] };
458
- this.predicate.predicates.push(tempPredicate);
453
+ const result = new Matcher();
454
+
455
+ result.predicate = {
456
+ type: 'and',
457
+ predicates: [
458
+ ...Matcher.predicates(this),
459
+ ...Matcher.predicates(matcher),
460
+ ].map(x => _.cloneDeep(x))
461
+ };
462
+
463
+ return result;
464
+ }
465
+
466
+ /** @private */
467
+ static *predicates(matcher) {
459
468
  if (matcher.predicate.type === 'and') {
460
- this.predicate.predicates = this.predicate.predicates.concat(matcher.predicate.predicates);
469
+ yield* matcher.predicate.predicates;
461
470
  } else {
462
- this.predicate.predicates.push(matcher.predicate);
471
+ yield matcher.predicate;
463
472
  }
464
- return this;
465
473
  }
466
474
  }
467
475
 
@@ -310,19 +310,19 @@ class DetoxLogger {
310
310
  /** @internal */
311
311
  static defaultOptions({ level }) {
312
312
  const ph = level === 'trace' || level === 'debug'
313
- ? value => require('chalk').grey(value) + ' '
314
- : value => require('chalk').grey(value);
313
+ ? value => require('chalk').default.grey(value) + ' '
314
+ : value => require('chalk').default.grey(value);
315
315
 
316
316
  const id = level === 'trace'
317
- ? value => require('chalk').yellow(`@${value}`)
317
+ ? value => require('chalk').default.yellow(`@${value}`)
318
318
  : undefined;
319
319
 
320
320
  const cat = level === 'trace' || level === 'debug'
321
- ? (value) => require('chalk').yellow(`${value}`.split(',', 1)[0])
321
+ ? (value) => require('chalk').default.yellow(`${value}`.split(',', 1)[0])
322
322
  : undefined;
323
323
 
324
324
  const event = level === 'trace' || level === 'debug'
325
- ? (value) => require('chalk').grey(`:${value}`)
325
+ ? (value) => require('chalk').default.grey(`:${value}`)
326
326
  : undefined;
327
327
 
328
328
  const identity = x => x;
@@ -41,13 +41,14 @@ class BunyanLogger {
41
41
  streamOptions.out = new PassThrough().pipe(process.stderr);
42
42
  }
43
43
 
44
- this._debugStream = {
44
+ this._bunyan.addStream({
45
45
  type: 'raw',
46
46
  level: config.level,
47
47
  stream: bds.default(streamOptions),
48
- };
48
+ });
49
+
50
+ this._debugStream = _.last(this._bunyan['streams']);
49
51
 
50
- this._bunyan.addStream(this._debugStream);
51
52
  return this;
52
53
  }
53
54
 
@@ -93,7 +94,7 @@ class BunyanLogger {
93
94
  : bunyanStream.stream;
94
95
 
95
96
  /* istanbul ignore next */
96
- return stream.fd !== undefined && !stream.closed;
97
+ return stream.fd > 2 && !stream.closed;
97
98
  }
98
99
  };
99
100
 
@@ -3,9 +3,9 @@ const funpermaproxy = require('funpermaproxy');
3
3
  const temporary = require('../artifacts/utils/temporaryPath');
4
4
  const { DetoxRuntimeError } = require('../errors');
5
5
  const { DetoxLogger, DetoxLogFinalizer, installLegacyTracerInterface } = require('../logger');
6
- const symbols = require('../symbols');
7
6
 
8
7
  const DetoxConstants = require('./DetoxConstants');
8
+ const symbols = require('./symbols');
9
9
 
10
10
  //#region Protected symbols
11
11
  const $cleanup = Symbol('cleanup');
@@ -135,7 +135,10 @@ class DetoxContext {
135
135
  */
136
136
  async [symbols.installWorker](opts) {
137
137
  if (opts.global) {
138
- opts.global['__detox__'] = this;
138
+ opts.global['__detox__'] = {
139
+ clientApi: require('../../index'),
140
+ internalsApi: require('../../internals'),
141
+ };
139
142
  this.log.overrideConsole(opts.global);
140
143
  }
141
144
 
@@ -1,6 +1,6 @@
1
1
  const funpermaproxy = require('funpermaproxy');
2
2
 
3
- const symbols = require('../symbols');
3
+ const symbols = require('./symbols');
4
4
 
5
5
  class DetoxInternalsFacade {
6
6
  /**
@@ -6,11 +6,11 @@ const onSignalExit = require('signal-exit');
6
6
  const temporary = require('../artifacts/utils/temporaryPath');
7
7
  const { DetoxRuntimeError } = require('../errors');
8
8
  const SessionState = require('../ipc/SessionState');
9
- const symbols = require('../symbols');
10
9
  const { getCurrentCommand } = require('../utils/argparse');
11
10
  const uuid = require('../utils/uuid');
12
11
 
13
12
  const DetoxContext = require('./DetoxContext');
13
+ const symbols = require('./symbols');
14
14
 
15
15
  // Protected symbols
16
16
  const { $logFinalizer, $restoreSessionState, $sessionState, $worker } = DetoxContext.protected;
@@ -135,7 +135,7 @@ class DetoxPrimaryContext extends DetoxContext {
135
135
  process.env.DETOX_CONFIG_SNAPSHOT_PATH = this[_sessionFile];
136
136
  this[_lifecycleLogger].trace(`Serialized the session state at: ${this[_sessionFile]}`);
137
137
 
138
- if (opts.workerId != null) {
138
+ if (opts.workerId !== null) {
139
139
  await this[symbols.installWorker](opts);
140
140
  }
141
141
  }
@@ -2,9 +2,9 @@ const fs = require('fs-extra');
2
2
 
3
3
  const { DetoxInternalError } = require('../errors');
4
4
  const SessionState = require('../ipc/SessionState');
5
- const symbols = require('../symbols');
6
5
 
7
6
  const DetoxContext = require('./DetoxContext');
7
+ const symbols = require('./symbols');
8
8
 
9
9
  // Protected symbols
10
10
  const { $restoreSessionState, $sessionState, $worker } = DetoxContext.protected;
File without changes
@@ -3,7 +3,7 @@ const DeviceRegistry = require('../../devices/DeviceRegistry');
3
3
  const AAPT = require('../../devices/common/drivers/android/exec/AAPT');
4
4
  const ADB = require('../../devices/common/drivers/android/exec/ADB');
5
5
  const ApkValidator = require('../../devices/common/drivers/android/tools/ApkValidator');
6
- const TempFileXfer = require('../../devices/common/drivers/android/tools/TempFileXfer');
6
+ const { TempFileTransfer } = require('../../devices/common/drivers/android/tools/TempFileTransfer');
7
7
 
8
8
  const AndroidServiceLocator = {
9
9
  get emulator() {
@@ -18,7 +18,7 @@ const AndroidServiceLocator = {
18
18
  AndroidServiceLocator.adb = new ADB();
19
19
  AndroidServiceLocator.aapt = new AAPT();
20
20
  AndroidServiceLocator.apkValidator = new ApkValidator(AndroidServiceLocator.aapt);
21
- AndroidServiceLocator.fileXfer = new TempFileXfer(AndroidServiceLocator.adb);
21
+ AndroidServiceLocator.fileTransfer = new TempFileTransfer(AndroidServiceLocator.adb);
22
22
  AndroidServiceLocator.deviceRegistry = DeviceRegistry.forAndroid();
23
23
  AndroidServiceLocator.devicePathBuilder = new AndroidDevicePathBuilder();
24
24
 
@@ -86,6 +86,7 @@ class ExclusiveLockfile {
86
86
  */
87
87
  _doRead() {
88
88
  const contents = fs.readFileSync(this._lockFilePath, this._options.read);
89
+ // @ts-ignore Node.js can parse buffer as JSON
89
90
  return JSON.parse(contents);
90
91
  }
91
92
 
@@ -1,15 +1,9 @@
1
1
  const path = require('path');
2
2
 
3
3
  const _ = require('lodash');
4
- const argv = require('minimist')(process.argv.slice(2));
5
4
 
6
5
  const { escape } = require('./pipeCommands');
7
6
 
8
- function getArgValue(key, alias) {
9
- const value = _getArgvValue(key, alias);
10
- return value === undefined ? getEnvValue(key) : value;
11
- }
12
-
13
7
  function getEnvValue(key) {
14
8
  const envKey = _.findKey(process.env, matchesKey(
15
9
  `DETOX_${_.snakeCase(key)}`.toUpperCase()
@@ -23,31 +17,12 @@ function getEnvValue(key) {
23
17
  return value;
24
18
  }
25
19
 
26
- function _getArgvValue(...aliases) {
27
- if (!argv) {
28
- return;
29
- }
30
-
31
- for (const alias of aliases) {
32
- if (alias && argv[alias]) {
33
- return argv[alias];
34
- }
35
- }
36
- }
37
-
38
20
  function matchesKey(key) {
39
21
  return /* istanbul ignore next */ process.platform === 'win32'
40
22
  ? (value, envKey) => envKey.toUpperCase() === key
41
23
  : (value, envKey) => envKey === key;
42
24
  }
43
25
 
44
- function getFlag(key) {
45
- if (argv && argv[key]) {
46
- return true;
47
- }
48
- return false;
49
- }
50
-
51
26
  const DEFAULT_JOIN_ARGUMENTS_OPTIONS = {
52
27
  prefix: '--',
53
28
  joiner: ' ',
@@ -92,9 +67,7 @@ function getCurrentCommand() {
92
67
  }
93
68
 
94
69
  module.exports = {
95
- getArgValue,
96
70
  getEnvValue,
97
- getFlag,
98
71
  joinArgs,
99
72
  getCurrentCommand,
100
73
  };
@@ -1 +0,0 @@
1
- ea6186058d129e19888773c331920f40
@@ -1 +0,0 @@
1
- c345c57a09f415daef9a23832141b5af2e18647e
@@ -1 +0,0 @@
1
- de444279abdbbef76d881b8130460cf395410b1076c87fc63e249167138ce04a
@@ -1 +0,0 @@
1
- a336b4f6dfcf0681162be31e004aa9f407876c27ed27d08e1f5261e351782b57e96fcd419a35acd0c45292c5ba11705b595d5f751c2fd548025161c9189ab7ef
@@ -1 +0,0 @@
1
- d1cc2d23f8f9f2b0a4bc726bbb62bfe8
@@ -1 +0,0 @@
1
- 0dfff4938eb6cdcbad7c459e00e03e5f74cf63e2
@@ -1 +0,0 @@
1
- 57d1a4ca0a22818cacb3fc0612ef95d2f2e2619975c678a96360c58564667d01
@@ -1 +0,0 @@
1
- c3aa7640f8f4d7fe4515fd64f6bf5dd2d086125b50e355fb7b7267c2973a992f159ab5723ffce5d52c90ced2c2e899692fa503804ebec6a28ecf9520c7fb4253
@@ -1 +0,0 @@
1
- 9f4287a9139d94b1eb35aef80da68b65
@@ -1 +0,0 @@
1
- dfa1ae19ebfa0add0b2392b3287e5885bd492768
@@ -1 +0,0 @@
1
- a0f706c4d9f8a2c9b33603874ac9c107ad50e4f74177c98f84cd28b2cfe305ec
@@ -1 +0,0 @@
1
- 7c5616e2dff6896bccaa3b98bbd0eb4085cfc2493ef4e0f3a6a75d4f6623059ab5ce912d80881eda8daa85f6d94aeecdc4661648f335523eb8e2e90cb47d40ae
@@ -1 +0,0 @@
1
- 707f23a53e4df7c923928f8ee9d9532b
@@ -1 +0,0 @@
1
- 314e61210f92969bb0b274cbe3e0dac1f04c0bdc
@@ -1 +0,0 @@
1
- 65a2960ffce341d2c351849d7d164f6fee2164dee2d3ca6963094444c28e15e5
@@ -1 +0,0 @@
1
- 8542c39f3f0b79257898244daaf665d4bca3f445833cbac16c11ba8a858928e38bae73227c2996f12c2ffa744ce350e00e96636a1ff212dfaa6730d6274bb559
@@ -1,16 +0,0 @@
1
- // @ts-nocheck
2
- const FileXfer = require('./FileXfer');
3
-
4
- const EMU_TEMP_PATH = '/data/local/tmp';
5
- const EMU_TEMP_INSTALL_PATH = `${EMU_TEMP_PATH}/detox`;
6
-
7
- class TempFileXfer extends FileXfer {
8
- /**
9
- * @param adb { ADB }
10
- */
11
- constructor(adb) {
12
- super(adb, EMU_TEMP_INSTALL_PATH);
13
- }
14
- }
15
-
16
- module.exports = TempFileXfer;
@@ -1,10 +0,0 @@
1
- function current() {
2
- if (process.env.DETOX_CONFIG_SNAPSHOT_PATH) {
3
- return require('./secondary');
4
- } else {
5
- return require('./primary');
6
- }
7
- }
8
-
9
- /** @type {DetoxInternals.Facade} */
10
- module.exports = global['__detox__'] || current();