detox 20.23.2-smoke.0 → 20.24.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. package/Detox-android/com/wix/detox/{20.23.2-smoke.0/detox-20.23.2-smoke.0-sources.jar → 20.24.0/detox-20.24.0-sources.jar} +0 -0
  2. package/Detox-android/com/wix/detox/20.24.0/detox-20.24.0-sources.jar.md5 +1 -0
  3. package/Detox-android/com/wix/detox/20.24.0/detox-20.24.0-sources.jar.sha1 +1 -0
  4. package/Detox-android/com/wix/detox/20.24.0/detox-20.24.0-sources.jar.sha256 +1 -0
  5. package/Detox-android/com/wix/detox/20.24.0/detox-20.24.0-sources.jar.sha512 +1 -0
  6. package/Detox-android/com/wix/detox/{20.23.2-smoke.0/detox-20.23.2-smoke.0.pom → 20.24.0/detox-20.24.0.pom} +1 -1
  7. package/Detox-android/com/wix/detox/20.24.0/detox-20.24.0.pom.md5 +1 -0
  8. package/Detox-android/com/wix/detox/20.24.0/detox-20.24.0.pom.sha1 +1 -0
  9. package/Detox-android/com/wix/detox/20.24.0/detox-20.24.0.pom.sha256 +1 -0
  10. package/Detox-android/com/wix/detox/20.24.0/detox-20.24.0.pom.sha512 +1 -0
  11. package/Detox-android/com/wix/detox/maven-metadata.xml +4 -4
  12. package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +1 -1
  13. package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +1 -1
  14. package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +1 -1
  15. package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +1 -1
  16. package/Detox-android/com/wix/detox-legacy/{20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0-sources.jar → 20.24.0/detox-legacy-20.24.0-sources.jar} +0 -0
  17. package/Detox-android/com/wix/detox-legacy/20.24.0/detox-legacy-20.24.0-sources.jar.md5 +1 -0
  18. package/Detox-android/com/wix/detox-legacy/20.24.0/detox-legacy-20.24.0-sources.jar.sha1 +1 -0
  19. package/Detox-android/com/wix/detox-legacy/20.24.0/detox-legacy-20.24.0-sources.jar.sha256 +1 -0
  20. package/Detox-android/com/wix/detox-legacy/20.24.0/detox-legacy-20.24.0-sources.jar.sha512 +1 -0
  21. package/Detox-android/com/wix/detox-legacy/{20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0.pom → 20.24.0/detox-legacy-20.24.0.pom} +1 -1
  22. package/Detox-android/com/wix/detox-legacy/20.24.0/detox-legacy-20.24.0.pom.md5 +1 -0
  23. package/Detox-android/com/wix/detox-legacy/20.24.0/detox-legacy-20.24.0.pom.sha1 +1 -0
  24. package/Detox-android/com/wix/detox-legacy/20.24.0/detox-legacy-20.24.0.pom.sha256 +1 -0
  25. package/Detox-android/com/wix/detox-legacy/20.24.0/detox-legacy-20.24.0.pom.sha512 +1 -0
  26. package/Detox-android/com/wix/detox-legacy/maven-metadata.xml +4 -4
  27. package/Detox-android/com/wix/detox-legacy/maven-metadata.xml.md5 +1 -1
  28. package/Detox-android/com/wix/detox-legacy/maven-metadata.xml.sha1 +1 -1
  29. package/Detox-android/com/wix/detox-legacy/maven-metadata.xml.sha256 +1 -1
  30. package/Detox-android/com/wix/detox-legacy/maven-metadata.xml.sha512 +1 -1
  31. package/Detox-ios-framework.tbz +0 -0
  32. package/Detox-ios-src.tbz +0 -0
  33. package/Detox-ios-xcuitest.tbz +0 -0
  34. package/detox.d.ts +16 -4
  35. package/internals.d.ts +7 -0
  36. package/local-cli/build.js +19 -16
  37. package/local-cli/start.js +3 -9
  38. package/local-cli/testCommand/TestRunnerCommand.js +6 -7
  39. package/package.json +2 -2
  40. package/src/configuration/composeCommandsConfig.js +42 -0
  41. package/src/configuration/index.js +7 -0
  42. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0-sources.jar.md5 +0 -1
  43. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0-sources.jar.sha1 +0 -1
  44. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0-sources.jar.sha256 +0 -1
  45. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0-sources.jar.sha512 +0 -1
  46. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0.pom.md5 +0 -1
  47. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0.pom.sha1 +0 -1
  48. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0.pom.sha256 +0 -1
  49. package/Detox-android/com/wix/detox/20.23.2-smoke.0/detox-20.23.2-smoke.0.pom.sha512 +0 -1
  50. package/Detox-android/com/wix/detox-legacy/20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0-sources.jar.md5 +0 -1
  51. package/Detox-android/com/wix/detox-legacy/20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0-sources.jar.sha1 +0 -1
  52. package/Detox-android/com/wix/detox-legacy/20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0-sources.jar.sha256 +0 -1
  53. package/Detox-android/com/wix/detox-legacy/20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0-sources.jar.sha512 +0 -1
  54. package/Detox-android/com/wix/detox-legacy/20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0.pom.md5 +0 -1
  55. package/Detox-android/com/wix/detox-legacy/20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0.pom.sha1 +0 -1
  56. package/Detox-android/com/wix/detox-legacy/20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0.pom.sha256 +0 -1
  57. package/Detox-android/com/wix/detox-legacy/20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0.pom.sha512 +0 -1
  58. /package/Detox-android/com/wix/detox/{20.23.2-smoke.0/detox-20.23.2-smoke.0.aar → 20.24.0/detox-20.24.0.aar} +0 -0
  59. /package/Detox-android/com/wix/detox/{20.23.2-smoke.0/detox-20.23.2-smoke.0.aar.md5 → 20.24.0/detox-20.24.0.aar.md5} +0 -0
  60. /package/Detox-android/com/wix/detox/{20.23.2-smoke.0/detox-20.23.2-smoke.0.aar.sha1 → 20.24.0/detox-20.24.0.aar.sha1} +0 -0
  61. /package/Detox-android/com/wix/detox/{20.23.2-smoke.0/detox-20.23.2-smoke.0.aar.sha256 → 20.24.0/detox-20.24.0.aar.sha256} +0 -0
  62. /package/Detox-android/com/wix/detox/{20.23.2-smoke.0/detox-20.23.2-smoke.0.aar.sha512 → 20.24.0/detox-20.24.0.aar.sha512} +0 -0
  63. /package/Detox-android/com/wix/detox-legacy/{20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0.aar → 20.24.0/detox-legacy-20.24.0.aar} +0 -0
  64. /package/Detox-android/com/wix/detox-legacy/{20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0.aar.md5 → 20.24.0/detox-legacy-20.24.0.aar.md5} +0 -0
  65. /package/Detox-android/com/wix/detox-legacy/{20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0.aar.sha1 → 20.24.0/detox-legacy-20.24.0.aar.sha1} +0 -0
  66. /package/Detox-android/com/wix/detox-legacy/{20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0.aar.sha256 → 20.24.0/detox-legacy-20.24.0.aar.sha256} +0 -0
  67. /package/Detox-android/com/wix/detox-legacy/{20.23.2-smoke.0/detox-legacy-20.23.2-smoke.0.aar.sha512 → 20.24.0/detox-legacy-20.24.0.aar.sha512} +0 -0
@@ -0,0 +1 @@
1
+ 619b3e428e498fda0870620ce2d3c5c4
@@ -0,0 +1 @@
1
+ 017905bcc89ab25f26a51c0d724680d83416b2e7
@@ -0,0 +1 @@
1
+ d88cd6cd15872d9f04c77c23c1c2fd4474787eb0f25333f08452c2fb4de8c74b
@@ -0,0 +1 @@
1
+ 2757b909c56c219bdb8fcb4b629523bcad05556234bf89ae5953b21e62c3a9676f45ad36ed3eb4b8a875a891406664c55a7102ff8933a8c4dcb8eecf3f2723a1
@@ -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.23.2-smoke.0</version>
6
+ <version>20.24.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
+ d6caeb72643d8530ef1b332e98566350
@@ -0,0 +1 @@
1
+ 13c3cb0d37f92bcd283ef5344897c975396b93d0
@@ -0,0 +1 @@
1
+ 348ea5305bc6ebd7658d9966eee32c073f268adf33e802a12469c2dad0c136bf
@@ -0,0 +1 @@
1
+ cf5032396a95a97fd964672c188382d46fd16195e5708a6b21f85322a678595d8923f7dac31479f05e1121af4fcef0734c22ceabdf22afd54db9213ccb70a9dc
@@ -3,11 +3,11 @@
3
3
  <groupId>com.wix</groupId>
4
4
  <artifactId>detox</artifactId>
5
5
  <versioning>
6
- <latest>20.23.2-smoke.0</latest>
7
- <release>20.23.2-smoke.0</release>
6
+ <latest>20.24.0</latest>
7
+ <release>20.24.0</release>
8
8
  <versions>
9
- <version>20.23.2-smoke.0</version>
9
+ <version>20.24.0</version>
10
10
  </versions>
11
- <lastUpdated>20240711082111</lastUpdated>
11
+ <lastUpdated>20240712095248</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- c5d84a01d446af422c8a56081568088e
1
+ cbe838e81e9b2489895384dbf73d9855
@@ -1 +1 @@
1
- cad52192217ab8710048332b8da4d7156c1a0a1b
1
+ 248526814045318fcaeda09d11dcff993503e58c
@@ -1 +1 @@
1
- 360e627f2037ff7be332f56c9b5803c66717c13a3a3177a89da116ad099c6245
1
+ 674cb578d4b1ab1e1f0f3af2f9e6b7d237e9417840a73f4a55181cc61aa55a75
@@ -1 +1 @@
1
- ca2e0fd044c3bdff63a5bc10274bb81b7b815f7aba16b5736c778910cc1bcb38148afe0db4f78b8009f47068eebe634061fbdbb4ae2ab754d6bdea69d3935a89
1
+ bf96117e1935d3a9c81337a743672b5ef93cc5c786026f5b2bca4118ab69c5c3b4a55600019581dc75f5b533e0fc310963e457df556d8b5108f2628aa246fbd8
@@ -0,0 +1 @@
1
+ 9e833c26f83f840d110b10f49e930040
@@ -0,0 +1 @@
1
+ 47fa17817e76b9388404db2f8af6adf908faa1cb
@@ -0,0 +1 @@
1
+ 4ad337ac65a1942992b394b1bacdbec38f2415032903af63d6dfbe7bf8539233
@@ -0,0 +1 @@
1
+ 5d9ddd3356f022e5a7a341caddb73a9a2deb69f36886824bda7e7f48f104ad94f7950924101dbd6248a7afd4cb03a8da2ae5a9a4b2f1cf498cae53f306a68ccf
@@ -3,7 +3,7 @@
3
3
  <modelVersion>4.0.0</modelVersion>
4
4
  <groupId>com.wix</groupId>
5
5
  <artifactId>detox-legacy</artifactId>
6
- <version>20.23.2-smoke.0</version>
6
+ <version>20.24.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
+ c0fb34a4b4869fb29fe7c29e071a8905
@@ -0,0 +1 @@
1
+ 01fb530a4a232d4ddd2428bc594a69de25963637
@@ -0,0 +1 @@
1
+ 6cb3e5c70e00b6dc5f102587810da45a304a2b61dc843161b00a9022cdae27de
@@ -0,0 +1 @@
1
+ d6a1b08152dc9a8c0f5defe3251ed611cd3fd2648702b54d12e53f00d3a8a1315897466eb02e31350379002eb74e8bbdd91539a91b18c5bfffa4a5fa8db78719
@@ -3,11 +3,11 @@
3
3
  <groupId>com.wix</groupId>
4
4
  <artifactId>detox-legacy</artifactId>
5
5
  <versioning>
6
- <latest>20.23.2-smoke.0</latest>
7
- <release>20.23.2-smoke.0</release>
6
+ <latest>20.24.0</latest>
7
+ <release>20.24.0</release>
8
8
  <versions>
9
- <version>20.23.2-smoke.0</version>
9
+ <version>20.24.0</version>
10
10
  </versions>
11
- <lastUpdated>20240711082136</lastUpdated>
11
+ <lastUpdated>20240712095305</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 0f436877f2c3b17a186f682bacb2d685
1
+ ebd10c4caa0af7ac57ef360ffe5e7c41
@@ -1 +1 @@
1
- 1c8b1bfd41b9caf20abbff6f9f344a73d91b54b4
1
+ 82e96d3f328e2794534a91f0b921dd1c51413e8e
@@ -1 +1 @@
1
- 54a26ecd056ecb46d3468291560a3ab91ead3065c8f71b659cf093fbc755709f
1
+ 1d2093dc2d529e5844dd5117be23864ddfc8101c2d5b5a935b48ce56cf434cb2
@@ -1 +1 @@
1
- 6e91dc08e997b3344ba8b2b6e7ff60177f6b9bd19a94e0b22330373361cdacbe7324b7b8164bf5809877663b573ed1968c36366cf8d3a2d69f15488bc94871e8
1
+ 515cd3e14cf792392678590d01108ca641e8ae53db46446f4fa7bbbebc9a680b8efd5568b7b5306ce4ed46e12e36c3fd9fe5d8c05e412a25cfbd5b5fd17a963d
Binary file
package/Detox-ios-src.tbz CHANGED
Binary file
Binary file
package/detox.d.ts CHANGED
@@ -33,6 +33,10 @@ declare global {
33
33
  logger?: DetoxLoggerConfig;
34
34
  session?: DetoxSessionConfig;
35
35
  testRunner?: DetoxTestRunnerConfig;
36
+ /** Build command for the entire configuration, overriding individual app build commands. */
37
+ build?: string;
38
+ /** Start command for the entire configuration, overriding individual app start commands. */
39
+ start?: string;
36
40
  };
37
41
 
38
42
  interface DetoxArtifactsConfig {
@@ -268,6 +272,18 @@ declare global {
268
272
  * @see Device#selectApp
269
273
  */
270
274
  name?: string;
275
+ /**
276
+ * Build command to be executed when you run `detox build`
277
+ * @example 'cd ios && xcodebuild -workspace example.xcworkspace ...'
278
+ * @example 'cd android && ./gradlew assembleDebug ...'
279
+ */
280
+ build?: string;
281
+ /**
282
+ * Development server start command to be executed when you run `detox start`
283
+ * Usually used in debug mode, but it depends on your application setup.
284
+ * @example 'react-native start'
285
+ */
286
+ start?: string;
271
287
  };
272
288
 
273
289
  type DetoxDeviceConfig = DetoxBuiltInDeviceConfig | DetoxCustomDriverConfig;
@@ -317,8 +333,6 @@ declare global {
317
333
  type: 'ios.app';
318
334
  binaryPath: string;
319
335
  bundleId?: string;
320
- build?: string;
321
- start?: string;
322
336
  launchArgs?: Record<string, any>;
323
337
  }
324
338
 
@@ -326,8 +340,6 @@ declare global {
326
340
  type: 'android.apk';
327
341
  binaryPath: string;
328
342
  bundleId?: string;
329
- build?: string;
330
- start?: string;
331
343
  testBinaryPath?: string;
332
344
  launchArgs?: Record<string, any>;
333
345
  /**
package/internals.d.ts CHANGED
@@ -245,6 +245,7 @@ declare global {
245
245
 
246
246
  type RuntimeConfig = Readonly<{
247
247
  configurationName: string;
248
+ commands: Readonly<RuntimeCommandsGroup>[];
248
249
 
249
250
  /**
250
251
  * Dictionary of app configurations,
@@ -274,6 +275,12 @@ declare global {
274
275
  }>;
275
276
  };
276
277
 
278
+ type RuntimeCommandsGroup = {
279
+ appName?: string;
280
+ build?: string;
281
+ start?: string;
282
+ };
283
+
277
284
  type CLIConfig = Readonly<Partial<{
278
285
  appLaunchArgs: string;
279
286
  artifactsLocation: string;
@@ -2,8 +2,6 @@
2
2
  const cp = require('child_process');
3
3
  const fs = require('fs');
4
4
 
5
- const _ = require('lodash');
6
-
7
5
  const detox = require('../internals');
8
6
 
9
7
  module.exports.command = 'build';
@@ -37,35 +35,40 @@ module.exports.builder = {
37
35
  };
38
36
 
39
37
  module.exports.handler = async function build(argv) {
40
- const { apps: appsConfig, errorComposer } = await detox.resolveConfig({ argv });
41
- const apps = _.entries(appsConfig);
38
+ const { apps, commands, errorComposer } = await detox.resolveConfig({ argv });
42
39
 
43
- for (const [appName, app] of apps) {
44
- const buildScript = app.build;
40
+ let seenBuildCommands = false;
45
41
 
46
- if (argv['if-missing'] && app.binaryPath && fs.existsSync(app.binaryPath)) {
47
- detox.log.info(`Skipping build for "${appName}" app...`);
48
- continue;
49
- }
42
+ for (const { appName, build } of commands) {
43
+ const app = apps[appName] || {};
44
+
45
+ if (build) {
46
+ seenBuildCommands = true;
47
+
48
+ if (argv['if-missing'] && app.binaryPath && fs.existsSync(app.binaryPath)) {
49
+ detox.log.info(`Skipping build for "${appName}" app...`);
50
+ continue;
51
+ }
50
52
 
51
- if (buildScript) {
52
53
  try {
53
- if (apps.length > 1) {
54
+ if (appName && commands.length > 1) {
54
55
  detox.log.info(`Building "${appName}" app...`);
55
56
  }
56
57
 
57
- detox.log.info(buildScript);
58
- cp.execSync(buildScript, { stdio: 'inherit' });
58
+ detox.log.info(build);
59
+ cp.execSync(build, { stdio: 'inherit' });
59
60
  } catch (e) {
60
61
  detox.log.warn("\n\nImportant: 'detox build' is a convenience shortcut for calling your own build command, as provided in the config file.\nFailures in this build command are not the responsibility of Detox. You are responsible for maintaining this command.\n");
61
62
  throw e;
62
63
  }
63
- } else if (!argv.silent) {
64
- throw errorComposer.missingBuildScript(app);
65
64
  }
66
65
 
67
66
  if (app.binaryPath && !fs.existsSync(app.binaryPath)) {
68
67
  detox.log.warn('After running the build command, Detox could not find your app at the given binary path:\n\t' + app.binaryPath + "\nMake sure it is correct, otherwise you'll get an error on an attempt to install your app.\n");
69
68
  }
70
69
  }
70
+
71
+ if (!seenBuildCommands && !argv.silent) {
72
+ throw errorComposer.missingBuildScript(Object.values(apps)[0]);
73
+ }
71
74
  };
@@ -1,5 +1,3 @@
1
- const _ = require('lodash');
2
-
3
1
  const detox = require('../internals');
4
2
 
5
3
  const AppStartCommand = require('./startCommand/AppStartCommand');
@@ -24,17 +22,13 @@ module.exports.builder = {
24
22
  };
25
23
 
26
24
  module.exports.handler = async function start(argv) {
27
- const { apps: appsConfig } = await detox.resolveConfig({ argv });
28
- const startCommands = _(appsConfig)
29
- .values()
30
- .map(app => app.start)
31
- .filter(Boolean)
25
+ const { commands } = await detox.resolveConfig({ argv });
26
+ const startCommands = commands.map(s => s.start).filter(Boolean)
32
27
  .map(cmd => new AppStartCommand({
33
28
  cmd,
34
29
  passthrough: argv['--'],
35
30
  forceSpawn: argv.force,
36
- }))
37
- .value();
31
+ }));
38
32
 
39
33
  if (startCommands.length) {
40
34
  try {
@@ -26,13 +26,13 @@ class TestRunnerCommand {
26
26
  const cliConfig = opts.config.cli;
27
27
  const deviceConfig = opts.config.device;
28
28
  const runnerConfig = opts.config.testRunner;
29
- const appsConfig = opts.config.apps;
29
+ const commands = opts.config.commands;
30
30
 
31
31
  this._argv = runnerConfig.args;
32
32
  this._detached = runnerConfig.detached;
33
33
  this._retries = runnerConfig.retries;
34
34
  this._envHint = this._buildEnvHint(opts.env);
35
- this._startCommands = this._prepareStartCommands(appsConfig, cliConfig);
35
+ this._startCommands = this._prepareStartCommands(commands, cliConfig);
36
36
  this._envFwd = {};
37
37
  this._terminating = false;
38
38
 
@@ -103,15 +103,14 @@ class TestRunnerCommand {
103
103
  .value();
104
104
  }
105
105
 
106
- _prepareStartCommands(appsConfig, cliConfig) {
106
+ _prepareStartCommands(commands, cliConfig) {
107
107
  if (`${cliConfig.start}` === 'false') {
108
108
  return [];
109
109
  }
110
110
 
111
- return _.values(appsConfig)
112
- .filter(app => app.start)
113
- .map(app => new AppStartCommand({
114
- cmd: app.start,
111
+ return _.filter(commands, 'start')
112
+ .map(commands => new AppStartCommand({
113
+ cmd: commands.start,
115
114
  forceSpawn: cliConfig.start === 'force',
116
115
  }));
117
116
  }
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.23.2-smoke.0",
4
+ "version": "20.24.0",
5
5
  "bin": {
6
6
  "detox": "local-cli/cli.js"
7
7
  },
@@ -115,5 +115,5 @@
115
115
  "browserslist": [
116
116
  "node 14"
117
117
  ],
118
- "gitHead": "eb228ba5b8e7da7d9e41ed17d51d6a59c497e640"
118
+ "gitHead": "4a442cee82115ef4eeb5dd618e8ab4d0281f4b2a"
119
119
  }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @param {{
3
+ * appsConfig: Record<string, Detox.DetoxAppConfig>
4
+ * localConfig: Detox.DetoxConfiguration;
5
+ * }} options
6
+ * @returns {DetoxInternals.RuntimeCommandsGroup[]}
7
+ */
8
+ function composeCommandsConfig(options) {
9
+ const { appsConfig, localConfig } = options;
10
+ /** @type {[string | undefined, Detox.DetoxAppConfig | Detox.DetoxConfiguration][]} */
11
+ const entries = [[undefined, localConfig], ...Object.entries(appsConfig)];
12
+
13
+ return entries.map(extractGroup).filter(hasCommands);
14
+ }
15
+
16
+ /**
17
+ * @param {[string | undefined, any]} script
18
+ * @param {number} index
19
+ * @param {[string | undefined, any][]} array
20
+ * @returns {DetoxInternals.RuntimeCommandsGroup}
21
+ */
22
+ function extractGroup([appName, { build, start }], index, [[, config]]) {
23
+ if (index === 0) {
24
+ return { build, start };
25
+ }
26
+
27
+ return {
28
+ appName,
29
+ build: config.build ? undefined : build,
30
+ start: config.start ? undefined : start
31
+ };
32
+ }
33
+
34
+ /**
35
+ * @param {DetoxInternals.RuntimeCommandsGroup} script
36
+ * @returns {boolean}
37
+ */
38
+ function hasCommands({ build, start }) {
39
+ return Boolean(build || start);
40
+ }
41
+
42
+ module.exports = composeCommandsConfig;
@@ -7,6 +7,7 @@ const collectCliConfig = require('./collectCliConfig');
7
7
  const composeAppsConfig = require('./composeAppsConfig');
8
8
  const composeArtifactsConfig = require('./composeArtifactsConfig');
9
9
  const composeBehaviorConfig = require('./composeBehaviorConfig');
10
+ const composeCommandsConfig = require('./composeCommandsConfig');
10
11
  const composeDeviceConfig = require('./composeDeviceConfig');
11
12
  const composeLoggerConfig = require('./composeLoggerConfig');
12
13
  const composeRunnerConfig = require('./composeRunnerConfig');
@@ -104,6 +105,11 @@ async function composeDetoxConfig({
104
105
  cliConfig,
105
106
  });
106
107
 
108
+ const commandsConfig = composeCommandsConfig({
109
+ appsConfig,
110
+ localConfig,
111
+ });
112
+
107
113
  const result = {
108
114
  configurationName,
109
115
 
@@ -111,6 +117,7 @@ async function composeDetoxConfig({
111
117
  artifacts: artifactsConfig,
112
118
  behavior: behaviorConfig,
113
119
  cli: cliConfig,
120
+ commands: commandsConfig,
114
121
  device: deviceConfig,
115
122
  logger: loggerConfig,
116
123
  testRunner: runnerConfig,
@@ -1 +0,0 @@
1
- ed1be2e6a4a9de036c4c82a3685fb64d
@@ -1 +0,0 @@
1
- fe5bfc9cdc8a8123e5a531e23e751cf58a74f18e
@@ -1 +0,0 @@
1
- c5f1e92eff24778043d565adaa667f26393176f02b9e21f2b79a464f3e96ab34
@@ -1 +0,0 @@
1
- 3c390122f86540122713417396dd8809c09f0c78809a88ce2889ff4c53122ad9e790d48b2d0dfb9475ec067631c1dc661d980eae2eb1005619a716cdf822006c
@@ -1 +0,0 @@
1
- 695ca8c83a9ca9732212ede0b994426d
@@ -1 +0,0 @@
1
- 01b188846e4b6c7903ad135bbf7dd481d9c49c7b
@@ -1 +0,0 @@
1
- eac469c94469dbc2f7e132654885574cea14019903725a418ca556a9223d4a07
@@ -1 +0,0 @@
1
- 4b1eca97bb0bd89458f81c369a2d2e7cdf894a2038b92bbe67a9b1e1feecf69dc605f580dfc5a6b9aee07df7342d95992f83cf50722d2667a235fcd522682f30
@@ -1 +0,0 @@
1
- dcc230930841e9d7686158e479f929b7a9d475a2
@@ -1 +0,0 @@
1
- 3e1bc603593d47252544ff8304b924a48e6ccc246261db360c8ecbc58172b01e
@@ -1 +0,0 @@
1
- c12048517a2a252f9caed898f73211a0485e0f5f34879eb4a4b11e492bbe1283a41a8a58345df0dd69ec822684a3a8d36dc86f539297a16c0b0c86f20ac9a617
@@ -1 +0,0 @@
1
- c40c157385354846dbace7287e4b216e5c8c2018
@@ -1 +0,0 @@
1
- 5549ceca38b4c6a6fe0dea84247db9eeedb2d3eabacf0630f68038a1d80ac248
@@ -1 +0,0 @@
1
- 3e7329a64b7d0411765f4620e46cd3f7cd493f6ccf0ce47e5526f83af72ab7a14fd60bf229ae4c6db96245e69d4ea308e2ee5b23d638142057ced5c562d2acd0