detox 20.0.12-prerelease.0 → 20.1.0-next-is-hittable-check.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. package/Detox-android/com/wix/detox/{20.0.12-prerelease.0/detox-20.0.12-prerelease.0-javadoc.jar → 20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0-javadoc.jar} +0 -0
  2. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0-javadoc.jar.md5 +1 -0
  3. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0-javadoc.jar.sha1 +1 -0
  4. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0-javadoc.jar.sha256 +1 -0
  5. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0-javadoc.jar.sha512 +1 -0
  6. package/Detox-android/com/wix/detox/{20.0.12-prerelease.0/detox-20.0.12-prerelease.0-sources.jar → 20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0-sources.jar} +0 -0
  7. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0-sources.jar.md5 +1 -0
  8. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0-sources.jar.sha1 +1 -0
  9. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0-sources.jar.sha256 +1 -0
  10. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0-sources.jar.sha512 +1 -0
  11. package/Detox-android/com/wix/detox/{20.0.12-prerelease.0/detox-20.0.12-prerelease.0.aar → 20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.aar} +0 -0
  12. package/Detox-android/com/wix/detox/{20.0.12-prerelease.0/detox-20.0.12-prerelease.0.aar.md5 → 20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.aar.md5} +0 -0
  13. package/Detox-android/com/wix/detox/{20.0.12-prerelease.0/detox-20.0.12-prerelease.0.aar.sha1 → 20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.aar.sha1} +0 -0
  14. package/Detox-android/com/wix/detox/{20.0.12-prerelease.0/detox-20.0.12-prerelease.0.aar.sha256 → 20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.aar.sha256} +0 -0
  15. package/Detox-android/com/wix/detox/{20.0.12-prerelease.0/detox-20.0.12-prerelease.0.aar.sha512 → 20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.aar.sha512} +0 -0
  16. package/Detox-android/com/wix/detox/{20.0.12-prerelease.0/detox-20.0.12-prerelease.0.pom → 20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.pom} +1 -1
  17. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.pom.md5 +1 -0
  18. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.pom.sha1 +1 -0
  19. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.pom.sha256 +1 -0
  20. package/Detox-android/com/wix/detox/20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.pom.sha512 +1 -0
  21. package/Detox-android/com/wix/detox/maven-metadata.xml +4 -4
  22. package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +1 -1
  23. package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +1 -1
  24. package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +1 -1
  25. package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +1 -1
  26. package/Detox-ios-src.tbz +0 -0
  27. package/Detox-ios.tbz +0 -0
  28. package/android/detox/proguard-rules-app.pro +4 -2
  29. package/index.d.ts +4 -4
  30. package/internals.d.ts +68 -12
  31. package/local-cli/test.js +4 -4
  32. package/local-cli/test.test.js +28 -24
  33. package/local-cli/testCommand/TestRunnerCommand.js +35 -27
  34. package/local-cli/utils/jestInternals.js +4 -1
  35. package/package.json +3 -3
  36. package/runners/jest/reporters/DetoxReporter.js +1 -1
  37. package/src/DetoxWorker.js +0 -6
  38. package/src/artifacts/ArtifactsManager.js +0 -18
  39. package/src/configuration/composeLoggerConfig.js +2 -2
  40. package/src/configuration/composeRunnerConfig.js +4 -3
  41. package/src/ipc/SessionState.js +1 -1
  42. package/src/logger/DetoxLogger.js +4 -6
  43. package/src/realms/DetoxContext.js +0 -6
  44. package/src/symbols.js +0 -12
  45. package/Detox-android/com/wix/detox/20.0.12-prerelease.0/detox-20.0.12-prerelease.0-javadoc.jar.md5 +0 -1
  46. package/Detox-android/com/wix/detox/20.0.12-prerelease.0/detox-20.0.12-prerelease.0-javadoc.jar.sha1 +0 -1
  47. package/Detox-android/com/wix/detox/20.0.12-prerelease.0/detox-20.0.12-prerelease.0-javadoc.jar.sha256 +0 -1
  48. package/Detox-android/com/wix/detox/20.0.12-prerelease.0/detox-20.0.12-prerelease.0-javadoc.jar.sha512 +0 -1
  49. package/Detox-android/com/wix/detox/20.0.12-prerelease.0/detox-20.0.12-prerelease.0-sources.jar.md5 +0 -1
  50. package/Detox-android/com/wix/detox/20.0.12-prerelease.0/detox-20.0.12-prerelease.0-sources.jar.sha1 +0 -1
  51. package/Detox-android/com/wix/detox/20.0.12-prerelease.0/detox-20.0.12-prerelease.0-sources.jar.sha256 +0 -1
  52. package/Detox-android/com/wix/detox/20.0.12-prerelease.0/detox-20.0.12-prerelease.0-sources.jar.sha512 +0 -1
  53. package/Detox-android/com/wix/detox/20.0.12-prerelease.0/detox-20.0.12-prerelease.0.pom.md5 +0 -1
  54. package/Detox-android/com/wix/detox/20.0.12-prerelease.0/detox-20.0.12-prerelease.0.pom.sha1 +0 -1
  55. package/Detox-android/com/wix/detox/20.0.12-prerelease.0/detox-20.0.12-prerelease.0.pom.sha256 +0 -1
  56. package/Detox-android/com/wix/detox/20.0.12-prerelease.0/detox-20.0.12-prerelease.0.pom.sha512 +0 -1
@@ -0,0 +1 @@
1
+ 251b43c4d9cac5fbae87a75c015c577257212beb1c9a0ab294981f8d12310019
@@ -0,0 +1 @@
1
+ 08cc04feb00bd8b233b990b7127b42af544865adf28b2cb57601c791d313672f0dbe20c5673d393395edeb970d8d11127c7eb098add143b13b044a62999d60a9
@@ -0,0 +1 @@
1
+ ebd8dbf8bb38883b6988fd82932ce0a09f287e13501ec31d80677abe8c077589
@@ -0,0 +1 @@
1
+ 35852565ad133c30234f00c3e518761068bf749a47e7c600e768b6b9756e76ed5fe40bfb139d5cdce27f30b9b76792c8cc2218f7086b39e68ac4658609eb75a5
@@ -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.0.12-prerelease.0</version>
6
+ <version>20.1.0-next-is-hittable-check.0</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
+ 76bdd7d38a6da78a81a590e378879fcb0f66c432af1bd280e0fdb60b37da7d79
@@ -0,0 +1 @@
1
+ 5a16f5124aec001470b9a4f9458674a477f8e844866ed2858bf096f0e27936d52b5e31c41d317e83d06ee200d5e9c5a2c302488e0d37eb7264fc5a55ffb03bb7
@@ -3,11 +3,11 @@
3
3
  <groupId>com.wix</groupId>
4
4
  <artifactId>detox</artifactId>
5
5
  <versioning>
6
- <latest>20.0.12-prerelease.0</latest>
7
- <release>20.0.12-prerelease.0</release>
6
+ <latest>20.1.0-next-is-hittable-check.0</latest>
7
+ <release>20.1.0-next-is-hittable-check.0</release>
8
8
  <versions>
9
- <version>20.0.12-prerelease.0</version>
9
+ <version>20.1.0-next-is-hittable-check.0</version>
10
10
  </versions>
11
- <lastUpdated>20221011170939</lastUpdated>
11
+ <lastUpdated>20221027091848</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 79cf31a8db7ad74ff1286cd11496ad71
1
+ 6abc81d3b72724caa7b05b479ec9cda4
@@ -1 +1 @@
1
- 0d7ee0e81eefa10376669b9858bd76020fde79ca
1
+ e5c15d3ad5f2372b8c9131eb4f9c431c34b534d6
@@ -1 +1 @@
1
- d36ef71b4b4869d33efcc8332d5a8ba0e78539d934e0bf9879af9ff9a47a8f29
1
+ 2bef8053b1c66b74321c2f2cc0c6f74bf2d3af4205804b5bab79e8417fc6d186
@@ -1 +1 @@
1
- 91d5852150f7da4be8a3758d64a7eb28bede7863ac6d34e56b81b1587b837c935a4e5af1e5476c0beb90ada1a154efc3028ae6e4f7878699d2942aba64293579
1
+ 347e4a189b393cf31f1b553b141f05e398c686487df11b8ba665395f05065aca3f9c87068c2b9c0dc078c3e09ca0dd7163144de81ae4031c199011a55cec03a1
package/Detox-ios-src.tbz CHANGED
Binary file
package/Detox-ios.tbz CHANGED
Binary file
@@ -1,4 +1,5 @@
1
1
  -keepattributes InnerClasses, Exceptions
2
+
2
3
  -keep class com.facebook.react.modules.** { *; }
3
4
  -keep class com.facebook.react.uimanager.** { *; }
4
5
  -keep class com.facebook.react.animated.** { *; }
@@ -8,8 +9,9 @@
8
9
  -keep class com.facebook.react.ReactInstanceManager** { *; }
9
10
  -keep class com.facebook.react.ReactInstanceEventListener { *; }
10
11
 
11
- -keep class com.facebook.react.views.slider.ReactSlider { *; }
12
- -keep class com.reactnativecommunity.slider.ReactSlider { *; }
12
+ -keep class com.facebook.react.views.slider.** { *; }
13
+ -keep class com.google.android.material.slider.** { *; }
14
+ -keep class com.reactnativecommunity.slider.** { *; }
13
15
  -keep class com.reactnativecommunity.asyncstorage.** { *; }
14
16
 
15
17
  -keep class kotlin.jvm.** { *; }
package/index.d.ts CHANGED
@@ -105,9 +105,9 @@ declare global {
105
105
  interface DetoxLoggerConfig {
106
106
  level?: DetoxLogLevel;
107
107
  /**
108
- * @default 'sandbox'
108
+ * @default true
109
109
  */
110
- overrideConsole?: 'all' | 'sandbox' | 'none';
110
+ overrideConsole?: boolean;
111
111
  options?: BunyanDebugStreamOptions | ((config: Partial<DetoxLoggerConfig>) => BunyanDebugStreamOptions);
112
112
  }
113
113
 
@@ -170,9 +170,9 @@ declare global {
170
170
  bail?: boolean;
171
171
  /**
172
172
  * Custom handler to process --inspect-brk CLI flag.
173
- * Use it when you rely on another test runner than Jest.
173
+ * Use it when you rely on another test runner than Jest to mutate the config.
174
174
  */
175
- inspectBrk?: boolean | ((config: DetoxTestRunnerConfig) => void);
175
+ inspectBrk?: (config: DetoxTestRunnerConfig) => void;
176
176
  /**
177
177
  * Forward environment variables to the spawned test runner
178
178
  * accordingly to the given CLI argument overrides.
package/internals.d.ts CHANGED
@@ -40,18 +40,71 @@ declare global {
40
40
  // endregion
41
41
 
42
42
  // region Lifecycle
43
- onRunStart(event: unknown): Promise<void>;
44
- onRunDescribeStart(event: unknown): Promise<void>;
45
- onTestStart(event: unknown): Promise<void>;
46
- onHookStart(event: unknown): Promise<void>;
47
- onHookFailure(event: unknown): Promise<void>;
48
- onHookSuccess(event: unknown): Promise<void>;
49
- onTestFnStart(event: unknown): Promise<void>;
50
- onTestFnFailure(event: unknown): Promise<void>;
51
- onTestFnSuccess(event: unknown): Promise<void>;
52
- onTestDone(event: unknown): Promise<void>;
53
- onRunDescribeFinish(event: unknown): Promise<void>;
54
- onRunFinish(event: unknown): Promise<void>;
43
+ /**
44
+ * Reports that the test runner started executing a test suite, e.g. a `beforeAll` hook or a first test.
45
+ */
46
+ onRunDescribeStart(event: {
47
+ /** Test suite name */
48
+ name: string;
49
+ }): Promise<void>;
50
+ /**
51
+ * Reports that the test runner started executing a specific test.
52
+ */
53
+ onTestStart(event: {
54
+ /** Test name */
55
+ title: string;
56
+ /** Test name including the ancestor suite titles */
57
+ fullName: string;
58
+ /**
59
+ * N-th time this test is running, if there is a retry mechanism.
60
+ *
61
+ * @default 1
62
+ */
63
+ invocations?: number;
64
+ status: 'running';
65
+ }): Promise<void>;
66
+ /**
67
+ * Reports about an error in the midst of `beforeAll`, `beforeEach`, `afterEach`, `afterAll` or any other hook.
68
+ */
69
+ onHookFailure(event: {
70
+ error: Error | string;
71
+ /**
72
+ * @example 'beforeAll'
73
+ * @example 'afterEach'
74
+ */
75
+ hook: string;
76
+ }): Promise<void>;
77
+ /**
78
+ * Reports about an error in the midst of a test function, `test` or `it`.
79
+ */
80
+ onTestFnFailure(event: {
81
+ error: Error | string;
82
+ }): Promise<void>;
83
+ /**
84
+ * Reports the final status of the test, `passed` or `failed`.
85
+ */
86
+ onTestDone(event: {
87
+ /** Test name */
88
+ title: string;
89
+ /** Test name including the ancestor suite titles */
90
+ fullName: string;
91
+ /**
92
+ * N-th time this test is running, if there is a retry mechanism.
93
+ *
94
+ * @default 1
95
+ */
96
+ invocations?: number;
97
+ status: 'passed' | 'failed';
98
+ /** Whether a timeout was the reason for why the test failed. */
99
+ timedOut?: boolean;
100
+ }): Promise<void>;
101
+ /**
102
+ * Reports that the test runner has finished executing a test suite, e.g. all the `afterAll` hooks have been executed or the last test has finished running.
103
+ */
104
+ onRunDescribeFinish(event: {
105
+ /** Test suite name */
106
+ name: string;
107
+ }): Promise<void>;
55
108
 
56
109
  /**
57
110
  * Reports to Detox CLI about passed and failed test files.
@@ -87,6 +140,9 @@ declare global {
87
140
 
88
141
  type DetoxInitOptions = {
89
142
  cwd: string;
143
+ /**
144
+ * @internal
145
+ */
90
146
  argv: Record<string, unknown>;
91
147
  testRunnerArgv: Record<string, unknown>;
92
148
  override: Partial<Detox.DetoxConfig>;
package/local-cli/test.js CHANGED
@@ -16,14 +16,14 @@ module.exports.handler = async function test({ detoxArgs, runnerArgs }) {
16
16
  };
17
17
 
18
18
  const config = await detox.resolveConfig(opts);
19
- if (!config.testRunner.inspectBrk) {
19
+ if (!detoxArgs['inspect-brk']) {
20
20
  await detox.init(opts);
21
21
  }
22
22
 
23
23
  const runnerCommand = new TestRunnerCommand()
24
- .setDeviceConfig(detox.config.device)
25
- .replicateCLIConfig(detox.config.cli)
26
- .setRunnerConfig(detox.config.testRunner);
24
+ .setDeviceConfig(config.device)
25
+ .replicateCLIConfig(config.cli)
26
+ .setRunnerConfig(config.testRunner);
27
27
 
28
28
  await runnerCommand.execute();
29
29
  } finally {
@@ -52,6 +52,7 @@ describe('CLI', () => {
52
52
  $0: os.platform() === 'win32' ? `node ${executable}` : executable,
53
53
  config: 'e2e/config.json'
54
54
  },
55
+ forwardEnv: true,
55
56
  },
56
57
  configurations: {
57
58
  single: {
@@ -114,11 +115,14 @@ describe('CLI', () => {
114
115
  });
115
116
 
116
117
  test('should not override environment variables', () => {
117
- expect(cliCall().env).toEqual({ DETOX_CONFIG_SNAPSHOT_PATH: expect.any(String) });
118
+ expect(cliCall().env).toEqual({
119
+ DETOX_CONFIG_PATH: expect.any(String),
120
+ DETOX_CONFIG_SNAPSHOT_PATH: expect.any(String)
121
+ });
118
122
  });
119
123
 
120
124
  test('should hint essential environment variables', () => {
121
- expect(cliCall().fullCommand).toMatch(/^DETOX_CONFIG_PATH=.*\bexecutable/);
125
+ expect(cliCall().fullCommand).toMatch(/\bDETOX_CONFIG_PATH=.*\bexecutable\b/);
122
126
  });
123
127
  });
124
128
 
@@ -135,7 +139,7 @@ describe('CLI', () => {
135
139
 
136
140
  test.each([['-l'], ['--loglevel']])('%s <value> should be passed as environment variable', async (__loglevel) => {
137
141
  await run(__loglevel, 'trace');
138
- expect(cliCall().env).not.toHaveProperty('DETOX_LOGLEVEL');
142
+ expect(cliCall().env).toHaveProperty('DETOX_LOGLEVEL');
139
143
  expect(cliCall().fullCommand).toMatch(/ DETOX_LOGLEVEL="trace" /);
140
144
  });
141
145
 
@@ -192,8 +196,8 @@ describe('CLI', () => {
192
196
  test.each([['-R'], ['--retries']])('%s <value> should not bail by default', async (__retries) => {
193
197
  await run(__retries, 2).catch(_.noop);
194
198
 
195
- expect(cliCall(0).env).not.toHaveProperty('DETOX_RERUN_INDEX');
196
199
  expect(cliCall(0).argv).toEqual([expect.stringMatching(/executable$/), '--config', 'e2e/config.json']);
200
+ expect(cliCall(1).env).not.toHaveProperty('DETOX_RERUN_INDEX');
197
201
  expect(cliCall(1).argv).toEqual([expect.stringMatching(/executable$/), '--config', 'e2e/config.json', 'e2e/failing1.test.js']);
198
202
  // note that it does not take the permanently failed test
199
203
  });
@@ -234,111 +238,111 @@ describe('CLI', () => {
234
238
 
235
239
  test.each([['-r'], ['--reuse']])('%s <value> should be passed as environment variable', async (__reuse) => {
236
240
  await run(__reuse);
237
- expect(cliCall().env).not.toHaveProperty('DETOX_REUSE');
241
+ expect(cliCall().env).toHaveProperty('DETOX_REUSE');
238
242
  expect(cliCall().fullCommand).toMatch(/\bDETOX_REUSE=true /);
239
243
  });
240
244
 
241
245
  test.each([['-u'], ['--cleanup']])('%s <value> should be passed as environment variable', async (__cleanup) => {
242
246
  await run(__cleanup);
243
- expect(cliCall().env).not.toHaveProperty('DETOX_CLEANUP');
247
+ expect(cliCall().env).toHaveProperty('DETOX_CLEANUP');
244
248
  expect(cliCall().fullCommand).toMatch(/\bDETOX_CLEANUP=true /);
245
249
  });
246
250
 
247
251
  test.each([['-d'], ['--debug-synchronization']])('%s <value> should be passed as environment variable', async (__debug_synchronization) => {
248
252
  await run(__debug_synchronization, 5000);
249
- expect(cliCall().env).not.toHaveProperty('DETOX_DEBUG_SYNCHRONIZATION');
253
+ expect(cliCall().env).toHaveProperty('DETOX_DEBUG_SYNCHRONIZATION');
250
254
  expect(cliCall().fullCommand).toMatch(/\bDETOX_DEBUG_SYNCHRONIZATION=5000 /);
251
255
  });
252
256
 
253
257
  test.each([['-d'], ['--debug-synchronization']])('%s <value> should be passed as 0 when given false', async (__debug_synchronization) => {
254
258
  await run(__debug_synchronization, false);
255
- expect(cliCall().env).not.toHaveProperty('DETOX_DEBUG_SYNCHRONIZATION');
259
+ expect(cliCall().env).toHaveProperty('DETOX_DEBUG_SYNCHRONIZATION');
256
260
  expect(cliCall().fullCommand).toMatch(/\bDETOX_DEBUG_SYNCHRONIZATION=0 /);
257
261
  });
258
262
 
259
263
  test.each([['-d'], ['--debug-synchronization']])('%s <value> should have default value = 3000', async (__debug_synchronization) => {
260
264
  await run(`${__debug_synchronization}`);
261
- expect(cliCall().env).not.toHaveProperty('DETOX_DEBUG_SYNCHRONIZATION');
265
+ expect(cliCall().env).toHaveProperty('DETOX_DEBUG_SYNCHRONIZATION');
262
266
  expect(cliCall().fullCommand).toMatch(/\bDETOX_DEBUG_SYNCHRONIZATION=3000 /);
263
267
  });
264
268
 
265
269
  test.each([['-a'], ['--artifacts-location']])('%s <value> should be passed as environment variable', async (__artifacts_location) => {
266
270
  await run(__artifacts_location, '/tmp');
267
- expect(cliCall().env).not.toHaveProperty('DETOX_ARTIFACTS_LOCATION');
271
+ expect(cliCall().env).toHaveProperty('DETOX_ARTIFACTS_LOCATION');
268
272
  expect(cliCall().fullCommand).toMatch(/\bDETOX_ARTIFACTS_LOCATION="\/tmp" /);
269
273
  });
270
274
 
271
275
  test('--record-logs <value> should be passed as environment variable', async () => {
272
276
  await run('--record-logs', 'all');
273
- expect(cliCall().env).not.toHaveProperty('DETOX_RECORD_LOGS');
277
+ expect(cliCall().env).toHaveProperty('DETOX_RECORD_LOGS');
274
278
  expect(cliCall().fullCommand).toMatch(/\bDETOX_RECORD_LOGS="all" /);
275
279
  });
276
280
 
277
281
  test('--take-screenshots <value> should be passed as environment variable', async () => {
278
282
  await run('--take-screenshots', 'failing');
279
- expect(cliCall().env).not.toHaveProperty('DETOX_TAKE_SCREENSHOTS');
283
+ expect(cliCall().env).toHaveProperty('DETOX_TAKE_SCREENSHOTS');
280
284
  expect(cliCall().fullCommand).toMatch(/\bDETOX_TAKE_SCREENSHOTS="failing" /);
281
285
  });
282
286
 
283
287
  test('--record-videos <value> should be passed as environment variable', async () => {
284
288
  await run('--record-videos', 'failing');
285
- expect(cliCall().env).not.toHaveProperty('DETOX_RECORD_VIDEOS');
289
+ expect(cliCall().env).toHaveProperty('DETOX_RECORD_VIDEOS');
286
290
  expect(cliCall().fullCommand).toMatch(/\bDETOX_RECORD_VIDEOS="failing" /);
287
291
  });
288
292
 
289
293
  test('--record-performance <value> should be passed as environment variable', async () => {
290
294
  await run('--record-performance', 'all');
291
- expect(cliCall().env).not.toHaveProperty('DETOX_RECORD_PERFORMANCE');
295
+ expect(cliCall().env).toHaveProperty('DETOX_RECORD_PERFORMANCE');
292
296
  expect(cliCall().fullCommand).toMatch(/\DETOX_RECORD_PERFORMANCE="all" /);
293
297
  });
294
298
 
295
299
  test('--capture-view-hierarchy <value> should be passed as environment variable', async () => {
296
300
  await run('--capture-view-hierarchy', 'enabled');
297
- expect(cliCall().env).not.toHaveProperty('DETOX_CAPTURE_VIEW_HIERARCHY');
301
+ expect(cliCall().env).toHaveProperty('DETOX_CAPTURE_VIEW_HIERARCHY');
298
302
  expect(cliCall().fullCommand).toMatch(/\DETOX_CAPTURE_VIEW_HIERARCHY="enabled" /);
299
303
  });
300
304
 
301
305
  test('--jest-report-specs, set explicitly, should be passed as an environment variable', async () => {
302
306
  await run('--jest-report-specs');
303
- expect(cliCall().env).not.toHaveProperty('DETOX_REPORT_SPECS');
307
+ expect(cliCall().env).toHaveProperty('DETOX_REPORT_SPECS');
304
308
  expect(cliCall().fullCommand).toMatch(/\bDETOX_REPORT_SPECS=true /);
305
309
  });
306
310
 
307
311
  test.each([['-H'], ['--headless']])('%s <value> should be passed as environment variable', async (__headless) => {
308
312
  await run(__headless);
309
- expect(cliCall().env).not.toHaveProperty('DETOX_HEADLESS');
313
+ expect(cliCall().env).toHaveProperty('DETOX_HEADLESS');
310
314
  expect(cliCall().fullCommand).toMatch(/\bDETOX_HEADLESS=true /);
311
315
  });
312
316
 
313
317
  test('--gpu <value> should be passed as environment variable', async () => {
314
318
  await run('--gpu', 'angle_indirect');
315
- expect(cliCall().env).not.toHaveProperty('DETOX_GPU');
319
+ expect(cliCall().env).toHaveProperty('DETOX_GPU');
316
320
  expect(cliCall().fullCommand).toMatch(/\bDETOX_GPU="angle_indirect" /);
317
321
  });
318
322
 
319
323
  test('--device-boot-args should be passed as an environment variable (without deprecation warnings)', async () => {
320
324
  await run('--device-boot-args="--verbose"');
321
- expect(cliCall().env).not.toHaveProperty('DETOX_DEVICE_BOOT_ARGS');
325
+ expect(cliCall().env).toHaveProperty('DETOX_DEVICE_BOOT_ARGS');
322
326
  expect(cliCall().fullCommand).toMatch(/\bDETOX_DEVICE_BOOT_ARGS="--verbose" /);
323
327
  expect(logger().warn).not.toHaveBeenCalledWith(DEVICE_LAUNCH_ARGS_DEPRECATION);
324
328
  });
325
329
 
326
330
  test('--device-launch-args should serve as a deprecated alias to --device-boot-args', async () => {
327
331
  await run(`--device-launch-args="--verbose"`);
328
- expect(cliCall().env).not.toHaveProperty('DETOX_DEVICE_BOOT_ARGS');
332
+ expect(cliCall().env).toHaveProperty('DETOX_DEVICE_BOOT_ARGS');
329
333
  expect(cliCall().fullCommand).toMatch(/\bDETOX_DEVICE_BOOT_ARGS="--verbose" /);
330
334
  expect(logger().warn).toHaveBeenCalledWith(DEVICE_LAUNCH_ARGS_DEPRECATION);
331
335
  });
332
336
 
333
337
  test('--app-launch-args should be passed as an environment variable', async () => {
334
338
  await run(`--app-launch-args="--debug yes"`);
335
- expect(cliCall().env).not.toHaveProperty('DETOX_APP_LAUNCH_ARGS');
339
+ expect(cliCall().env).toHaveProperty('DETOX_APP_LAUNCH_ARGS');
336
340
  expect(cliCall().fullCommand).toMatch(/\bDETOX_APP_LAUNCH_ARGS="--debug yes" /);
337
341
  });
338
342
 
339
343
  test('--use-custom-logger false should be prevent passing environment variable', async () => {
340
344
  await run(`--use-custom-logger=false`);
341
- expect(cliCall().env).not.toHaveProperty('DETOX_USE_CUSTOM_LOGGER');
345
+ expect(cliCall().env).toHaveProperty('DETOX_USE_CUSTOM_LOGGER');
342
346
  expect(cliCall().fullCommand).toMatch(/\bDETOX_USE_CUSTOM_LOGGER=false /);
343
347
  });
344
348
 
@@ -352,13 +356,13 @@ describe('CLI', () => {
352
356
  test('--force-adb-install should be passed as environment variable', async () => {
353
357
  singleConfig().device.type = 'android.emulator';
354
358
  await run(`--force-adb-install`);
355
- expect(cliCall().env).not.toHaveProperty('DETOX_FORCE_ADB_INSTALL');
359
+ expect(cliCall().env).toHaveProperty('DETOX_FORCE_ADB_INSTALL');
356
360
  expect(cliCall().fullCommand).toMatch(/\bDETOX_FORCE_ADB_INSTALL=true /);
357
361
  });
358
362
 
359
363
  test.each([['-n'], ['--device-name']])('%s <value> should be passed as environment variable', async (__device_name) => {
360
364
  await run(__device_name, 'TheDevice');
361
- expect(cliCall().env).not.toHaveProperty('DETOX_DEVICE_NAME');
365
+ expect(cliCall().env).toHaveProperty('DETOX_DEVICE_NAME');
362
366
  expect(cliCall().fullCommand).toMatch(/\bDETOX_DEVICE_NAME="TheDevice" /);
363
367
  });
364
368
 
@@ -13,43 +13,20 @@ const { escapeSpaces } = require('../../src/utils/shellUtils');
13
13
  class TestRunnerCommand {
14
14
  constructor() {
15
15
  this._argv = {};
16
- this._env = {};
16
+ this._cli2env = {};
17
17
  this._envHint = {};
18
+ this._envFwd = {};
18
19
  this._retries = 0;
19
20
  /** @type {Detox.DetoxDeviceConfig} */
20
21
  this._deviceConfig = null;
21
22
  }
22
23
 
23
- /**
24
- * @param {Detox.DetoxDeviceConfig} config
25
- * @returns {this}
26
- */
27
- setDeviceConfig(config) {
28
- this._deviceConfig = config;
29
-
30
- return this;
31
- }
32
-
33
- /**
34
- * @param {Detox.DetoxTestRunnerConfig} config
35
- * @returns {this}
36
- */
37
- setRunnerConfig(config) {
38
- this._argv = config.args;
39
- this._retries = config.inspectBrk ? 0 : config.retries;
40
- if (config.inspectBrk || config.forwardEnv) {
41
- this._env = this._envHint;
42
- }
43
-
44
- return this;
45
- }
46
-
47
24
  /**
48
25
  * @param {Partial<Readonly<DetoxInternals.CLIConfig>>} cliConfig
49
26
  * @returns {this}
50
27
  */
51
28
  replicateCLIConfig(cliConfig) {
52
- this._envHint = _.omitBy({
29
+ this._cli2env = _.omitBy({
53
30
  DETOX_APP_LAUNCH_ARGS: cliConfig.appLaunchArgs,
54
31
  DETOX_ARTIFACTS_LOCATION: cliConfig.artifactsLocation,
55
32
  DETOX_CAPTURE_VIEW_HIERARCHY: cliConfig.captureViewHierarchy,
@@ -77,6 +54,37 @@ class TestRunnerCommand {
77
54
  DETOX_USE_CUSTOM_LOGGER: cliConfig.useCustomLogger,
78
55
  }, _.isUndefined);
79
56
 
57
+ this._envHint = _(process.env)
58
+ .mapKeys((_value, key) => key.toUpperCase())
59
+ .pickBy((_value, key) => key.startsWith('DETOX_'))
60
+ .omit(['DETOX_CONFIG_SNAPSHOT_PATH'])
61
+ .value();
62
+
63
+ return this;
64
+ }
65
+
66
+ /**
67
+ * @param {Detox.DetoxDeviceConfig} config
68
+ * @returns {this}
69
+ */
70
+ setDeviceConfig(config) {
71
+ this._deviceConfig = config;
72
+
73
+ return this;
74
+ }
75
+
76
+ /**
77
+ * @param {Detox.DetoxTestRunnerConfig} config
78
+ * @returns {this}
79
+ */
80
+ setRunnerConfig(config) {
81
+ this._argv = config.args;
82
+ this._retries = config.inspectBrk ? 0 : config.retries;
83
+ if (config.forwardEnv) {
84
+ this._envFwd = this._cli2env;
85
+ Object.assign(this._envHint, this._cli2env);
86
+ }
87
+
80
88
  return this;
81
89
  }
82
90
 
@@ -136,7 +144,7 @@ class TestRunnerCommand {
136
144
  stdio: 'inherit',
137
145
  env: _({})
138
146
  .assign(process.env)
139
- .assign(this._env)
147
+ .assign(this._envFwd)
140
148
  .omitBy(_.isUndefined)
141
149
  .tap(prependNodeModulesBinToPATH)
142
150
  .value()
@@ -4,6 +4,7 @@ const path = require('path');
4
4
 
5
5
  const _ = require('lodash');
6
6
  const resolveFrom = require('resolve-from');
7
+ const semver = require('semver');
7
8
 
8
9
  const { DetoxRuntimeError } = require('../../src/errors');
9
10
 
@@ -50,7 +51,9 @@ function resolveJestCliArgs() {
50
51
 
51
52
  try {
52
53
  const jestCliManifest = resolveJestDependency(jestLocation, 'jest-cli/package.json');
53
- const argsJsFile = path.join(path.dirname(jestCliManifest), 'build/cli/args.js');
54
+ const jestCliVersion = require(jestCliManifest).version;
55
+ const argsJsFilePath = semver.gt(jestCliVersion, '29.1.2') ? 'build/args.js' : 'build/cli/args.js';
56
+ const argsJsFile = path.join(path.dirname(jestCliManifest), argsJsFilePath);
54
57
 
55
58
  return require(argsJsFile);
56
59
  } catch (e) {
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.0.12-prerelease.0",
4
+ "version": "20.1.0-next-is-hittable-check.0",
5
5
  "bin": {
6
6
  "detox": "local-cli/cli.js"
7
7
  },
@@ -92,7 +92,7 @@
92
92
  "yargs-unparser": "^2.0.0"
93
93
  },
94
94
  "peerDependencies": {
95
- "jest": "28.x.x || ^27.2.5"
95
+ "jest": "29.x.x || 28.x.x || ^27.2.5"
96
96
  },
97
97
  "peerDependenciesMeta": {
98
98
  "jest": {
@@ -184,5 +184,5 @@
184
184
  }
185
185
  }
186
186
  },
187
- "gitHead": "3cd7feb90f69058ec124fa085cdacc8d167161a7"
187
+ "gitHead": "941babbb7b2b0ebef688a92b6f616f83ea738468"
188
188
  }
@@ -17,7 +17,7 @@ class DetoxReporter extends JestVerboseReporter {
17
17
  testExecError: testResult.testExecError,
18
18
  isPermanentFailure: config.testRunner.jest.retryAfterCircusRetries
19
19
  ? false
20
- : testResult.testResults.some(r => r.invocations > 1)
20
+ : testResult.testResults.some(r => r.status === 'failed' && r.invocations > 1)
21
21
  }]);
22
22
  }
23
23
  }
@@ -190,7 +190,6 @@ class DetoxWorker {
190
190
  return this._context.log;
191
191
  }
192
192
 
193
- onRunStart = async (...args) => this._artifactsManager.onRunStart(...args);
194
193
  onRunDescribeStart = async (...args) => this._artifactsManager.onRunDescribeStart(...args);
195
194
  onTestStart = async (testSummary) => {
196
195
  if (this._isCleaningUp) return;
@@ -205,12 +204,8 @@ class DetoxWorker {
205
204
  if (this._isCleaningUp) return;
206
205
  await this._artifactsManager.onTestStart(testSummary);
207
206
  };
208
- onHookStart = async (...args) => this._artifactsManager.onHookStart(...args);
209
207
  onHookFailure = async (...args) => this._artifactsManager.onHookFailure(...args);
210
- onHookSuccess = async (...args) => this._artifactsManager.onHookSuccess(...args);
211
- onTestFnStart = async (...args) => this._artifactsManager.onTestFnStart(...args);
212
208
  onTestFnFailure = async (...args) => this._artifactsManager.onTestFnFailure(...args);
213
- onTestFnSuccess = async (...args) => this._artifactsManager.onTestFnSuccess(...args);
214
209
  onTestDone = async (testSummary) => {
215
210
  if (this._isCleaningUp) return;
216
211
  this._validateTestSummary('afterEach', testSummary);
@@ -225,7 +220,6 @@ class DetoxWorker {
225
220
  });
226
221
  };
227
222
  onRunDescribeFinish = async (...args) => this._artifactsManager.onRunDescribeFinish(...args);
228
- onRunFinish = async (...args) => this._artifactsManager.onRunFinish(...args);
229
223
 
230
224
  async _reinstallAppsOnDevice() {
231
225
  const appNames = _(this._appsConfig)
@@ -32,19 +32,13 @@ class ArtifactsManager extends EventEmitter {
32
32
  'onBootDevice',
33
33
  'onCreateExternalArtifact',
34
34
  'onHookFailure',
35
- 'onHookStart',
36
- 'onHookSuccess',
37
35
  'onLaunchApp',
38
36
  'onRunDescribeFinish',
39
37
  'onRunDescribeStart',
40
- 'onRunFinish',
41
- 'onRunStart',
42
38
  'onShutdownDevice',
43
39
  'onTerminateApp',
44
40
  'onTestDone',
45
41
  'onTestFnFailure',
46
- 'onTestFnStart',
47
- 'onTestFnSuccess',
48
42
  'onTestStart',
49
43
  ]);
50
44
  }
@@ -185,8 +179,6 @@ class ArtifactsManager extends EventEmitter {
185
179
  });
186
180
  }
187
181
 
188
- async onRunStart() {}
189
-
190
182
  async onRunDescribeStart(suite) {
191
183
  await this._callPlugins('ascending', 'onRunDescribeStart', suite);
192
184
  }
@@ -195,22 +187,14 @@ class ArtifactsManager extends EventEmitter {
195
187
  await this._callPlugins('ascending', 'onTestStart', testSummary);
196
188
  }
197
189
 
198
- async onHookStart() {}
199
-
200
190
  async onHookFailure(testSummary) {
201
191
  await this._callPlugins('plain', 'onHookFailure', testSummary);
202
192
  }
203
193
 
204
- async onHookSuccess() {}
205
-
206
- async onTestFnStart() {}
207
-
208
194
  async onTestFnFailure(testSummary) {
209
195
  await this._callPlugins('plain', 'onTestFnFailure', testSummary);
210
196
  }
211
197
 
212
- async onTestFnSuccess() {}
213
-
214
198
  async onTestDone(testSummary) {
215
199
  await this._callPlugins('descending', 'onTestDone', testSummary);
216
200
  }
@@ -219,8 +203,6 @@ class ArtifactsManager extends EventEmitter {
219
203
  await this._callPlugins('descending', 'onRunDescribeFinish', suite);
220
204
  }
221
205
 
222
- async onRunFinish() {}
223
-
224
206
  async onBeforeCleanup() {
225
207
  await this._callPlugins('descending', 'onBeforeCleanup');
226
208
  await this._idlePromise;
@@ -14,7 +14,7 @@ function composeLoggerConfig(opts) {
14
14
  const items = [
15
15
  {
16
16
  level: 'info',
17
- overrideConsole: 'sandbox',
17
+ overrideConsole: true,
18
18
  options: defaultOptions,
19
19
  },
20
20
  globalConfig.logger,
@@ -46,7 +46,7 @@ function adaptCLI(cliConfig) {
46
46
  }
47
47
 
48
48
  if (cliConfig.useCustomLogger !== undefined) {
49
- result.overrideConsole = cliConfig.useCustomLogger ? 'all' : 'none';
49
+ result.overrideConsole = cliConfig.useCustomLogger;
50
50
  }
51
51
 
52
52
  if (cliConfig.noColor) {
@@ -56,11 +56,12 @@ function composeRunnerConfig(opts) {
56
56
 
57
57
  if (typeof merged.inspectBrk === 'function') {
58
58
  if (cliConfig.inspectBrk) {
59
+ merged.retries = 0;
60
+ merged.forwardEnv = true;
59
61
  merged.inspectBrk(merged);
60
- merged.inspectBrk = true;
61
- } else {
62
- merged.inspectBrk = false;
63
62
  }
63
+
64
+ delete merged.inspectBrk;
64
65
  }
65
66
 
66
67
  return merged;
@@ -41,7 +41,7 @@ class SessionState {
41
41
  }
42
42
 
43
43
  static reviver(key, val) {
44
- if (typeof val === 'object' && typeof val.$fn == 'string') {
44
+ if (typeof val === 'object' && val !== null && typeof val.$fn == 'string') {
45
45
  return eval(val.$fn);
46
46
  } else {
47
47
  return val;
@@ -55,7 +55,7 @@ class DetoxLogger {
55
55
 
56
56
  this._sharedConfig.userConfig = this._sharedConfig.userConfig || {
57
57
  level: 'info',
58
- overrideConsole: 'none',
58
+ overrideConsole: false,
59
59
  options: {
60
60
  showDate: false,
61
61
  showLoggerName: false,
@@ -143,14 +143,12 @@ class DetoxLogger {
143
143
  * @internal
144
144
  */
145
145
  overrideConsole(sandbox) {
146
- const option = this.config.overrideConsole;
147
- if (option === 'none') {
146
+ const enabled = this.config.overrideConsole;
147
+ if (!enabled) {
148
148
  return;
149
149
  }
150
150
 
151
- if ((option === 'sandbox' && sandbox) || option === 'all') {
152
- customConsoleLogger.overrideConsoleMethods((sandbox || global).console, this);
153
- }
151
+ customConsoleLogger.overrideConsoleMethods((sandbox || global).console, this);
154
152
  }
155
153
 
156
154
  /**
@@ -80,18 +80,12 @@ class DetoxContext {
80
80
  //#endregion
81
81
 
82
82
  //#region Internal members
83
- [symbols.onRunStart] = (...args) => this[symbols.worker].onRunStart(...args);
84
83
  [symbols.onRunDescribeStart] = (...args) => this[symbols.worker].onRunDescribeStart(...args);
85
84
  [symbols.onTestStart] = (...args) => this[symbols.worker].onTestStart(...args);
86
- [symbols.onHookStart] = (...args) => this[symbols.worker].onHookStart(...args);
87
85
  [symbols.onHookFailure] = (...args) => this[symbols.worker].onHookFailure(...args);
88
- [symbols.onHookSuccess] = (...args) => this[symbols.worker].onHookSuccess(...args);
89
- [symbols.onTestFnStart] = (...args) => this[symbols.worker].onTestFnStart(...args);
90
86
  [symbols.onTestFnFailure] = (...args) => this[symbols.worker].onTestFnFailure(...args);
91
- [symbols.onTestFnSuccess] = (...args) => this[symbols.worker].onTestFnSuccess(...args);
92
87
  [symbols.onTestDone] = (...args) => this[symbols.worker].onTestDone(...args);
93
88
  [symbols.onRunDescribeFinish] = (...args) => this[symbols.worker].onRunDescribeFinish(...args);
94
- [symbols.onRunFinish] = (...args) => this[symbols.worker].onRunFinish(...args);
95
89
  [symbols.config] = funpermaproxy(() => this[symbols.session].detoxConfig);
96
90
  [symbols.session] = funpermaproxy(() => this[$sessionState]);
97
91
  [symbols.tracing] = Object.freeze({
package/src/symbols.js CHANGED
@@ -7,16 +7,10 @@
7
7
  * readonly installWorker: unique symbol;
8
8
  * readonly logger: unique symbol;
9
9
  * readonly onHookFailure: unique symbol;
10
- * readonly onHookStart: unique symbol;
11
- * readonly onHookSuccess: unique symbol;
12
10
  * readonly onRunDescribeFinish: unique symbol;
13
11
  * readonly onRunDescribeStart: unique symbol;
14
- * readonly onRunFinish: unique symbol;
15
- * readonly onRunStart: unique symbol;
16
12
  * readonly onTestDone: unique symbol;
17
13
  * readonly onTestFnFailure: unique symbol;
18
- * readonly onTestFnStart: unique symbol;
19
- * readonly onTestFnSuccess: unique symbol;
20
14
  * readonly onTestStart: unique symbol;
21
15
  * readonly reportTestResults: unique symbol;
22
16
  * readonly resolveConfig: unique symbol;
@@ -28,18 +22,12 @@
28
22
  */
29
23
  module.exports = {
30
24
  //#region Lifecycle
31
- onRunStart: Symbol('run_start'),
32
25
  onRunDescribeStart: Symbol('run_describe_start'),
33
26
  onTestStart: Symbol('test_start'),
34
- onHookStart: Symbol('hook_start'),
35
27
  onHookFailure: Symbol('hook_failure'),
36
- onHookSuccess: Symbol('hook_success'),
37
- onTestFnStart: Symbol('test_fn_start'),
38
28
  onTestFnFailure: Symbol('test_fn_failure'),
39
- onTestFnSuccess: Symbol('test_fn_success'),
40
29
  onTestDone: Symbol('test_done'),
41
30
  onRunDescribeFinish: Symbol('run_describe_finish'),
42
- onRunFinish: Symbol('run_finish'),
43
31
  //#endregion
44
32
 
45
33
  //#region IPC
@@ -1 +0,0 @@
1
- 79e4ecf9e3a592932f8ee594c287345fbcb50ccc
@@ -1 +0,0 @@
1
- b9135f4a994d21ab1543c223940ba2eae57411c514b6b5ede58db8179ef48ec5
@@ -1 +0,0 @@
1
- 035992cf8193c98d4335ca7f94842ca794a8a40f94f437a076eee068d930a86623d1e6d7755f624fcad632e092faa445b83557ae297c2ba7f05131848c251fa4
@@ -1 +0,0 @@
1
- c3769eddce862d29deba41c68b1c3457056d746c
@@ -1 +0,0 @@
1
- 3263d7cca6d9ae2a88716ef6aa4cd936d47b6c27888c7b3c40c6f745e3407d60
@@ -1 +0,0 @@
1
- 190e018641c86048d3c8f61efcdd8694d91b099c863f7740898f311bfb2e927179ceed13502e6efad6a915846271c0fc46177a7ac692cdda1899a9ca320dc852
@@ -1 +0,0 @@
1
- 0493506a4e0ab469402bb1ec8060d6be
@@ -1 +0,0 @@
1
- 368ca67e6718ee04781403230f984973b7226f4e
@@ -1 +0,0 @@
1
- 516654dfdf2f2ef5dc08619ab644dd4aeca1a2603bad93520897a6206b43554d
@@ -1 +0,0 @@
1
- d02dc795d31bf3818e6682da9bbef6399c611cfcd5ed9189f8ff9edad231bd5c98c66b0582fc86cd1843abcaf57cda394cb47e3ba5be641325357b656dcc9585