@nx/detox 16.1.3 → 16.2.0-beta.0

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.
package/migrations.json CHANGED
@@ -29,6 +29,12 @@
29
29
  "version": "16.0.0-beta.3",
30
30
  "description": "Update .detoxrc.json and jest.config.json for detox 20",
31
31
  "implementation": "./src/migrations/update-16-0-0/update-detoxrc-json"
32
+ },
33
+ "update-detoxrc-json-expo-16-1-4": {
34
+ "cli": "nx",
35
+ "version": "16.1.4-beta.0",
36
+ "description": "Update .detoxrc.json for expo",
37
+ "implementation": "./src/migrations/update-16-1-4/update-detoxrc-json-expo"
32
38
  }
33
39
  },
34
40
  "packageJsonUpdates": {
@@ -222,6 +228,28 @@
222
228
  "alwaysAddToPackageJson": false
223
229
  }
224
230
  }
231
+ },
232
+ "16.1.1": {
233
+ "version": "16.1.1-beta.0",
234
+ "packages": {
235
+ "detox": {
236
+ "version": "~20.8.0",
237
+ "alwaysAddToPackageJson": false
238
+ },
239
+ "@config-plugins/detox": {
240
+ "version": "~5.0.1",
241
+ "alwaysAddToPackageJson": false
242
+ }
243
+ }
244
+ },
245
+ "16.1.5": {
246
+ "version": "16.1.5-beta.0",
247
+ "packages": {
248
+ "detox": {
249
+ "version": "^20.9.0",
250
+ "alwaysAddToPackageJson": false
251
+ }
252
+ }
225
253
  }
226
254
  }
227
255
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/detox",
3
- "version": "16.1.3",
3
+ "version": "16.2.0-beta.0",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Detox contains executors and generators for allowing your workspace to use the powerful Detox integration testing capabilities.",
6
6
  "keywords": [
@@ -25,15 +25,15 @@
25
25
  "main": "./index",
26
26
  "types": "index.d.ts",
27
27
  "dependencies": {
28
- "@nrwl/detox": "16.1.3",
29
- "@nx/devkit": "16.1.3",
30
- "@nx/jest": "16.1.3",
31
- "@nx/js": "16.1.3",
32
- "@nx/linter": "16.1.3",
33
- "@nx/react": "16.1.3"
28
+ "@nrwl/detox": "16.2.0-beta.0",
29
+ "@nx/devkit": "16.2.0-beta.0",
30
+ "@nx/jest": "16.2.0-beta.0",
31
+ "@nx/js": "16.2.0-beta.0",
32
+ "@nx/linter": "16.2.0-beta.0",
33
+ "@nx/react": "16.2.0-beta.0"
34
34
  },
35
35
  "peerDependencies": {
36
- "detox": "~20.7.0"
36
+ "detox": "^20.9.0"
37
37
  },
38
38
  "builders": "./executors.json",
39
39
  "ng-update": {
@@ -44,5 +44,5 @@
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "gitHead": "a6642bf2a87616e2791ade7dc9b570a3e4908974"
47
+ "gitHead": "f7ba85e8ec9c074eaee81731a20aee7ea6dbc8aa"
48
48
  }
@@ -7,8 +7,16 @@
7
7
  "cli": "nx",
8
8
  "presets": [
9
9
  {
10
- "name": "Run tests",
11
- "keys": ["detoxConfiguration", "loglevel", "reuse"]
10
+ "name": "Test a Detox Configuration",
11
+ "keys": ["detoxConfiguration"]
12
+ },
13
+ {
14
+ "name": "Reuse Existing Installed App",
15
+ "keys": ["reuse"]
16
+ },
17
+ {
18
+ "name": "Set Log Level",
19
+ "keys": ["loglevel"]
12
20
  }
13
21
  ],
14
22
  "properties": {
@@ -35,22 +43,26 @@
35
43
  "x-completion-glob": ".detoxrc?(.js)",
36
44
  "x-priority": "important"
37
45
  },
38
- "runnerConfig": {
39
- "type": "string",
40
- "description": "Test runner config file, defaults to `e2e/mocha.opts` for mocha and `e2e/config.json` for Jest.",
41
- "alias": "o"
42
- },
43
- "deviceName": {
44
- "type": "string",
45
- "description": "Override the device name specified in a configuration. Useful for running a single build configuration on multiple devices.",
46
- "alias": "n"
47
- },
48
46
  "loglevel": {
49
47
  "type": "string",
50
48
  "enum": ["fatal", "error", "warn", "info", "verbose", "trace"],
51
49
  "description": "Log level: `fatal`, `error`, `warn`, `info`, `verbose`, `trace`.",
52
50
  "alias": "l"
53
51
  },
52
+ "retries": {
53
+ "type": "number",
54
+ "description": "[Jest Circus Only] Re-spawn the test runner for individual failing suite files until they pass, or `<N>` times at least."
55
+ },
56
+ "reuse": {
57
+ "type": "boolean",
58
+ "description": "Reuse existing installed app (do not delete + reinstall) for a faster run.",
59
+ "default": false
60
+ },
61
+ "cleanup": {
62
+ "type": "boolean",
63
+ "description": "Shutdown simulator when test is over, useful for CI scripts, to make sure detox exists cleanly with no residue",
64
+ "alias": "u"
65
+ },
54
66
  "debugSynchronization": {
55
67
  "type": "boolean",
56
68
  "description": "Customize how long an action/expectation can take to complete before Detox starts querying the app why it is busy. By default, the app status will be printed if the action takes more than 10s to complete.",
@@ -81,33 +93,11 @@
81
93
  "enum": ["all", "none"],
82
94
  "description": "[iOS Only] Save Detox Instruments performance recordings of each test to artifacts directory."
83
95
  },
84
- "recordTimeline": {
85
- "type": "string",
86
- "enum": ["all", "none"],
87
- "description": "[Jest Only] Record tests and events timeline, for visual display on the `chrome://tracing` tool."
88
- },
89
96
  "captureViewHierarchy": {
90
97
  "type": "string",
91
98
  "enum": ["enabled", "disabled"],
92
99
  "description": "[iOS Only] Capture `*.uihierarchy` snapshots on view action errors and `device.captureViewHierarchy()` calls."
93
100
  },
94
- "retries": {
95
- "type": "number",
96
- "description": "[Jest Circus Only] Re-spawn the test runner for individual failing suite files until they pass, or `<N>` times at least."
97
- },
98
- "reuse": {
99
- "type": "boolean",
100
- "description": "Reuse existing installed app (do not delete + reinstall) for a faster run.",
101
- "default": true
102
- },
103
- "cleanup": {
104
- "type": "boolean",
105
- "description": "Shutdown simulator when test is over, useful for CI scripts, to make sure detox exists cleanly with no residue"
106
- },
107
- "workers": {
108
- "type": "number",
109
- "description": "Specifies number of workers the test runner should spawn, requires a test runner with parallel execution support (Detox CLI currently supports Jest)."
110
- },
111
101
  "jestReportSpecs": {
112
102
  "type": "boolean",
113
103
  "description": "[Jest Only] Whether to output logs per each running spec, in real-time. By default, disabled with multiple workers."
@@ -120,18 +110,23 @@
120
110
  "type": "boolean",
121
111
  "description": "[Android Only] Launch Emulator with the specific `-gpu [gpu mode]` parameter."
122
112
  },
123
- "deviceLaunchArgs": {
113
+ "keepLockFile": {
114
+ "type": "boolean",
115
+ "description": "Keep the device lock file when running Detox tests."
116
+ },
117
+ "deviceName": {
118
+ "type": "string",
119
+ "description": "Override the device name specified in a configuration. Useful for running a single build configuration on multiple devices.",
120
+ "alias": "n"
121
+ },
122
+ "deviceBootArgs": {
124
123
  "type": "string",
125
- "description": "A list of passthrough-arguments to use when (if) devices (Android emulator / iOS simulator) are launched by Detox."
124
+ "description": "Custom arguments to pass (through) onto the device (emulator/simulator) binary when booted."
126
125
  },
127
126
  "appLaunchArgs": {
128
127
  "type": "number",
129
128
  "description": "Custom arguments to pass (through) onto the app every time it is launched."
130
129
  },
131
- "noColor": {
132
- "type": "boolean",
133
- "description": "Disable colors in log output"
134
- },
135
130
  "useCustomLogger": {
136
131
  "type": "boolean",
137
132
  "description": "Use Detox' custom console-logging implementation, for logging Detox (non-device) logs. Disabling will fallback to Node.js / test-runner's implementation (e.g. Jest / Mocha)."
@@ -143,6 +138,32 @@
143
138
  "inspectBrk": {
144
139
  "type": "boolean",
145
140
  "description": "Uses node's `--inspect-brk` flag to let users debug the jest/mocha test runner"
141
+ },
142
+ "color": {
143
+ "type": "boolean",
144
+ "description": "Colors in log output"
145
+ },
146
+ "runnerConfig": {
147
+ "type": "string",
148
+ "description": "Test runner config file, defaults to `e2e/mocha.opts` for mocha and `e2e/config.json` for Jest.",
149
+ "alias": "o",
150
+ "x-deprecated": "Deprecated in Detox 20. It is default to jest.config.json. It could be specified in .detoxrc.json"
151
+ },
152
+ "recordTimeline": {
153
+ "type": "string",
154
+ "enum": ["all", "none"],
155
+ "description": "[Jest Only] Record tests and events timeline, for visual display on the `chrome://tracing` tool.",
156
+ "x-deprecated": "Deprecated in Detox 20."
157
+ },
158
+ "workers": {
159
+ "type": "number",
160
+ "description": "Specifies number of workers the test runner should spawn, requires a test runner with parallel execution support (Detox CLI currently supports Jest).",
161
+ "x-deprecated": "Deprecated in Detox 20."
162
+ },
163
+ "deviceLaunchArgs": {
164
+ "type": "string",
165
+ "description": "A list of passthrough-arguments to use when (if) devices (Android emulator / iOS simulator) are launched by Detox.",
166
+ "x-deprecated": "Deprecated in Detox 20. Use `deviceBootArgs` instead."
146
167
  }
147
168
  },
148
169
  "required": ["detoxConfiguration"]
@@ -11,7 +11,7 @@ function detoxTestExecutor(options, context) {
11
11
  return tslib_1.__asyncGenerator(this, arguments, function* detoxTestExecutor_1() {
12
12
  const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
13
13
  try {
14
- if (options.buildTarget) {
14
+ if (!options.reuse && options.buildTarget) {
15
15
  const buildTarget = (0, devkit_1.parseTargetString)(options.buildTarget, context.projectGraph);
16
16
  const buildOptions = (0, devkit_1.readTargetOptions)(buildTarget, context);
17
17
  yield tslib_1.__await((0, build_impl_1.runCliBuild)(context.root, projectRoot, Object.assign(Object.assign({}, buildOptions), { detoxConfiguration: options.detoxConfiguration })));
@@ -59,11 +59,17 @@ function createDetoxTestOptions(options) {
59
59
  else if (k === 'detoxConfiguration') {
60
60
  acc.push('--configuration', propertyValue);
61
61
  }
62
- else if (k === 'deviceLaunchArgs') {
63
- acc.push(`--device-launch-args="${propertyValue}"`); // the value must be specified after an equal sign (=) and inside quotes.
62
+ else if (k === 'deviceBootArgs') {
63
+ acc.push(`--device-boot-args="${propertyValue}"`); // the value must be specified after an equal sign (=) and inside quotes: https://wix.github.io/Detox/docs/cli/test
64
64
  }
65
65
  else if (k === 'appLaunchArgs') {
66
- acc.push(`--app-launch-argss="${propertyValue}"`); // the value must be specified after an equal sign (=) and inside quotes.
66
+ acc.push(`--app-launch-args="${propertyValue}"`); // the value must be specified after an equal sign (=) and inside quotes: https://wix.github.io/Detox/docs/cli/test
67
+ }
68
+ else if (k === 'color') {
69
+ // detox only accepts --no-color, not --color
70
+ if (!propertyValue) {
71
+ acc.push('--no-color');
72
+ }
67
73
  }
68
74
  else {
69
75
  const propertyName = (0, devkit_2.names)(k).fileName; // convert camelCase to kebab-case
@@ -1 +1 @@
1
- {"version":3,"file":"test.impl.js","sourceRoot":"","sources":["../../../../../../packages/detox/src/executors/test/test.impl.ts"],"names":[],"mappings":";;;AAAA,uCAIoB;AACpB,uCAAmC;AACnC,+BAA4B;AAC5B,iDAAmD;AAGnD,oDAAkD;AAQlD,IAAI,YAA0B,CAAC;AAE/B,SAA+B,iBAAiB,CAC9C,OAAyB,EACzB,OAAwB;;QAExB,MAAM,WAAW,GACf,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;QAEpE,IAAI;YACF,IAAI,OAAO,CAAC,WAAW,EAAE;gBACvB,MAAM,WAAW,GAAG,IAAA,0BAAiB,EACnC,OAAO,CAAC,WAAW,EACnB,OAAO,CAAC,YAAY,CACrB,CAAC;gBACF,MAAM,YAAY,GAAG,IAAA,0BAAiB,EACpC,WAAW,EACX,OAAO,CACR,CAAC;gBAEF,sBAAM,IAAA,wBAAW,EAAC,OAAO,CAAC,IAAI,EAAE,WAAW,kCACtC,YAAY,KACf,kBAAkB,EAAE,OAAO,CAAC,kBAAkB,IAC9C,CAAA,CAAC;aACJ;YAED,sBAAM,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,CAAA,CAAC;YAErD,4BAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA,CAAC;SACzB;gBAAS;YACR,IAAI,YAAY,EAAE;gBAChB,YAAY,CAAC,IAAI,EAAE,CAAC;aACrB;SACF;IACH,CAAC;CAAA;AAhCD,oCAgCC;AAED,SAAS,UAAU,CACjB,aAAqB,EACrB,WAAmB,EACnB,OAAyB;IAEzB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,YAAY,GAAG,IAAA,oBAAI,EACjB,IAAA,WAAI,EAAC,aAAa,EAA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C,KAAK,kBAAkB,EAAE;YACnC,GAAG,CAAC,IAAI,CAAC,yBAAyB,aAAa,GAAG,CAAC,CAAC,CAAC,yEAAyE;SAC/H;aAAM,IAAI,CAAC,KAAK,eAAe,EAAE;YAChC,GAAG,CAAC,IAAI,CAAC,uBAAuB,aAAa,GAAG,CAAC,CAAC,CAAC,yEAAyE;SAC7H;aAAM;YACL,MAAM,YAAY,GAAG,IAAA,cAAK,EAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,kCAAkC;YAC1E,GAAG,CAAC,IAAI,CAAC,KAAK,YAAY,EAAE,EAAE,aAAa,CAAC,CAAC;SAC9C;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
1
+ {"version":3,"file":"test.impl.js","sourceRoot":"","sources":["../../../../../../packages/detox/src/executors/test/test.impl.ts"],"names":[],"mappings":";;;AAAA,uCAIoB;AACpB,uCAAmC;AACnC,+BAA4B;AAC5B,iDAAmD;AAGnD,oDAAkD;AAQlD,IAAI,YAA0B,CAAC;AAE/B,SAA+B,iBAAiB,CAC9C,OAAyB,EACzB,OAAwB;;QAExB,MAAM,WAAW,GACf,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;QAEpE,IAAI;YACF,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,WAAW,EAAE;gBACzC,MAAM,WAAW,GAAG,IAAA,0BAAiB,EACnC,OAAO,CAAC,WAAW,EACnB,OAAO,CAAC,YAAY,CACrB,CAAC;gBACF,MAAM,YAAY,GAAG,IAAA,0BAAiB,EACpC,WAAW,EACX,OAAO,CACR,CAAC;gBAEF,sBAAM,IAAA,wBAAW,EAAC,OAAO,CAAC,IAAI,EAAE,WAAW,kCACtC,YAAY,KACf,kBAAkB,EAAE,OAAO,CAAC,kBAAkB,IAC9C,CAAA,CAAC;aACJ;YAED,sBAAM,UAAU,CA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CAAC,aAAa,CAAC,CAAC;AAElC,SAAS,sBAAsB,CAAC,OAAyB;IACvD,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;QAC5C,MAAM,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACjC,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;YACzB,OAAO,GAAG,CAAC;SACZ;aAAM,IAAI,CAAC,KAAK,oBAAoB,EAAE;YACrC,GAAG,CAAC,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;SAC5C;aAAM,IAAI,CAAC,KAAK,gBAAgB,EAAE;YACjC,GAAG,CAAC,IAAI,CAAC,uBAAuB,aAAa,GAAG,CAAC,CAAC,CAAC,mHAAmH;SACvK;aAAM,IAAI,CAAC,KAAK,eAAe,EAAE;YAChC,GAAG,CAAC,IAAI,CAAC,sBAAsB,aAAa,GAAG,CAAC,CAAC,CAAC,mHAAmH;SACtK;aAAM,IAAI,CAAC,KAAK,OAAO,EAAE;YACxB,6CAA6C;YAC7C,IAAI,CAAC,aAAa,EAAE;gBAClB,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;aACxB;SACF;aAAM;YACL,MAAM,YAAY,GAAG,IAAA,cAAK,EAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,kCAAkC;YAC1E,GAAG,CAAC,IAAI,CAAC,KAAK,YAAY,EAAE,EAAE,aAAa,CAAC,CAAC;SAC9C;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
@@ -22,12 +22,12 @@
22
22
  <% if (framework === 'expo') { %>
23
23
  "ios.eas": {
24
24
  "type": "ios.app",
25
- "build": "<%= exec %> nx run <%= appFileName %>:download --platform ios --distribution simulator --output=<%= appRoot %>/dist/",
25
+ "build": "<%= exec %> nx run <%= appFileName %>:download --platform ios --distribution simulator --output=<%= offsetFromRoot %><%= appRoot %>/dist/",
26
26
  "binaryPath": "<%= offsetFromRoot %><%= appRoot %>/dist/<%= appExpoName %>.app"
27
27
  },
28
28
  "ios.local": {
29
29
  "type": "ios.app",
30
- "build": "<%= exec %> nx run <%= appFileName %>:build --platform ios --profile preview --wait --local --no-interactive --output=<%= appRoot %>/dist/",
30
+ "build": "<%= exec %> nx run <%= appFileName %>:build --platform ios --profile preview --wait --local --no-interactive --output=<%= offsetFromRoot %><%= appRoot %>/dist/<%= appExpoName %>.tar.gz",
31
31
  "binaryPath": "<%= offsetFromRoot %><%= appRoot %>/dist/<%= appExpoName %>.app"
32
32
  },
33
33
  <% } %>
@@ -43,13 +43,13 @@
43
43
  },
44
44
  <% if (framework === 'expo') { %>
45
45
  "android.eas": {
46
- "type": "ios.app",
47
- "build": "<%= exec %> nx run <%= appFileName %>:download --platform android --output=<%= appRoot %>/dist/",
46
+ "type": "android.apk",
47
+ "build": "<%= exec %> nx run <%= appFileName %>:download --platform android --distribution simulator --output=<%= offsetFromRoot %><%= appRoot %>/dist/",
48
48
  "binaryPath": "<%= offsetFromRoot %><%= appRoot %>/dist/<%= appExpoName %>.apk"
49
49
  },
50
50
  "android.local": {
51
- "type": "ios.app",
52
- "build": "<%= exec %> nx run <%= appFileName %>:build --platform android --profile preview --wait --local --no-interactive --output=<%= appRoot %>/dist/",
51
+ "type": "android.apk",
52
+ "build": "<%= exec %> nx run <%= appFileName %>:build --platform android --profile preview --wait --local --no-interactive --output=<%= offsetFromRoot %><%= appRoot %>/dist/<%= appExpoName %>.apk",
53
53
  "binaryPath": "<%= offsetFromRoot %><%= appRoot %>/dist/<%= appExpoName %>.apk"
54
54
  },
55
55
  <% } %>
@@ -97,11 +97,11 @@
97
97
  },
98
98
  <% if (framework === 'expo') { %>
99
99
  "android.emu.eas": {
100
- "device": "simulator",
100
+ "device": "emulator",
101
101
  "app": "android.eas"
102
102
  },
103
103
  "android.emu.local": {
104
- "device": "simulator",
104
+ "device": "emulator",
105
105
  "app": "android.local"
106
106
  },
107
107
  <% } %>
@@ -17,7 +17,7 @@ exports.reactNativeBuildTarget = reactNativeBuildTarget;
17
17
  function expoBuildTarget(platform) {
18
18
  return {
19
19
  options: {
20
- detoxConfiguration: `${platform}.debug`,
20
+ detoxConfiguration: `${platform}.eas`,
21
21
  },
22
22
  configurations: {
23
23
  local: {
@@ -1 +1 @@
1
- {"version":3,"file":"get-targets.js","sourceRoot":"","sources":["../../../../../../../packages/detox/src/generators/application/lib/get-targets.ts"],"names":[],"mappings":";;;AAAA,SAAgB,sBAAsB,CAAC,QAAmC;IACxE,OAAO;QACL,OAAO,EAAE;YACP,kBAAkB,EAAE,GAAG,QAAQ,QAAQ;SACxC;QACD,cAAc,EAAE;YACd,UAAU,EAAE;gBACV,kBAAkB,EAAE,GAAG,QAAQ,UAAU;aAC1C;SACF;KACF,CAAC;AACJ,CAAC;AAXD,wDAWC;AAED,SAAgB,eAAe,CAAC,QAAmC;IACjE,OAAO;QACL,OAAO,EAAE;YACP,kBAAkB,EAAE,GAAG,QAAQ,QAAQ;SACxC;QACD,cAAc,EAAE;YACd,KAAK,EAAE;gBACL,kBAAkB,EAAE,GAAG,QAAQ,QAAQ;aACxC;YACD,IAAI,EAAE;gBACJ,kBAAkB,EAAE,GAAG,QAAQ,QAAQ;aACxC;YACD,UAAU,EAAE;gBACV,kBAAkB,EAAE,GAAG,QAAQ,UAAU;aAC1C;SACF;KACF,CAAC;AACJ,CAAC;AAjBD,0CAiBC;AAED,SAAgB,qBAAqB,CACnC,QAAmC,EACnC,OAAe;IAEf,MAAM,aAAa,GAAG,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAEjE,OAAO;QACL,OAAO,EAAE;YACP,kBAAkB,EAAE,GAAG,QAAQ,QAAQ;YACvC,WAAW,EAAE,GAAG,OAAO,UAAU,aAAa,EAAE;SACjD;QACD,cAAc,EAAE;YACd,UAAU,EAAE;gBACV,kBAAkB,EAAE,GAAG,QAAQ,UAAU;gBACzC,WAAW,EAAE,GAAG,OAAO,UAAU,aAAa,aAAa;aAC5D;SACF;KACF,CAAC;AACJ,CAAC;AAlBD,sDAkBC;AAED,SAAgB,cAAc,CAC5B,QAAmC,EACnC,OAAe;IAEf,MAAM,aAAa,GAAG,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAEjE,OAAO;QACL,OAAO,EAAE;YACP,kBAAkB,EAAE,GAAG,QAAQ,MAAM;YACrC,WAAW,EAAE,GAAG,OAAO,UAAU,aAAa,EAAE;SACjD;QACD,cAAc,EAAE;YACd,KAAK,EAAE;gBACL,kBAAkB,EAAE,GAAG,QAAQ,QAAQ;gBACvC,WAAW,EAAE,GAAG,OAAO,UAAU,aAAa,QAAQ;aACvD;YACD,IAAI,EAAE;gBACJ,kBAAkB,EAAE,GAAG,QAAQ,QAAQ;gBACvC,WAAW,EAAE,GAAG,OAAO,UAAU,aAAa,OAAO;aACtD;YACD,UAAU,EAAE;gBACV,kBAAkB,EAAE,GAAG,QAAQ,UAAU;gBACzC,WAAW,EAAE,GAAG,OAAO,UAAU,aAAa,aAAa;aAC5D;SACF;KACF,CAAC;AACJ,CAAC;AA1BD,wCA0BC"}
1
+ {"version":3,"file":"get-targets.js","sourceRoot":"","sources":["../../../../../../../packages/detox/src/generators/application/lib/get-targets.ts"],"names":[],"mappings":";;;AAAA,SAAgB,sBAAsB,CAAC,QAAmC;IACxE,OAAO;QACL,OAAO,EAAE;YACP,kBAAkB,EAAE,GAAG,QAAQ,QAAQ;SACxC;QACD,cAAc,EAAE;YACd,UAAU,EAAE;gBACV,kBAAkB,EAAE,GAAG,QAAQ,UAAU;aAC1C;SACF;KACF,CAAC;AACJ,CAAC;AAXD,wDAWC;AAED,SAAgB,eAAe,CAAC,QAAmC;IACjE,OAAO;QACL,OAAO,EAAE;YACP,kBAAkB,EAAE,GAAG,QAAQ,MAAM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,kBAAkB,EAAE,GAAG,QAAQ,UAAU;gBACzC,WAAW,EAAE,GAAG,OAAO,UAAU,aAAa,aAAa;aAC5D;SACF;KACF,CAAC;AACJ,CAAC;AA1BD,wCA0BC"}
@@ -1,6 +1,6 @@
1
1
  import { GeneratorCallback, Tree } from '@nx/devkit';
2
2
  import { Schema } from './schema';
3
3
  export declare function detoxInitGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
4
- export declare function updateDependencies(host: Tree): GeneratorCallback;
4
+ export declare function updateDependencies(host: Tree, schema: Schema): GeneratorCallback;
5
5
  export default detoxInitGenerator;
6
6
  export declare const detoxInitSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
@@ -10,7 +10,7 @@ function detoxInitGenerator(host, schema) {
10
10
  const tasks = [];
11
11
  if (!schema.skipPackageJson) {
12
12
  tasks.push(moveDependency(host));
13
- tasks.push(updateDependencies(host));
13
+ tasks.push(updateDependencies(host, schema));
14
14
  }
15
15
  if (!schema.skipFormat) {
16
16
  yield (0, devkit_1.formatFiles)(host);
@@ -19,14 +19,10 @@ function detoxInitGenerator(host, schema) {
19
19
  });
20
20
  }
21
21
  exports.detoxInitGenerator = detoxInitGenerator;
22
- function updateDependencies(host) {
23
- return (0, devkit_1.addDependenciesToPackageJson)(host, {}, {
24
- '@nx/detox': versions_2.nxVersion,
25
- detox: versions_2.detoxVersion,
26
- '@testing-library/jest-dom': versions_2.testingLibraryJestDom,
27
- '@types/node': versions_1.typesNodeVersion,
28
- 'jest-circus': versions_1.jestVersion,
29
- });
22
+ function updateDependencies(host, schema) {
23
+ return (0, devkit_1.addDependenciesToPackageJson)(host, {}, Object.assign({ '@nx/detox': versions_2.nxVersion, detox: versions_2.detoxVersion, '@testing-library/jest-dom': versions_2.testingLibraryJestDom, '@types/node': versions_1.typesNodeVersion, 'jest-circus': versions_1.jestVersion }, (schema.framework === 'expo'
24
+ ? { '@config-plugins/detox': versions_2.configPluginsDetoxVersion }
25
+ : {})));
30
26
  }
31
27
  exports.updateDependencies = updateDependencies;
32
28
  function moveDependency(host) {
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/detox/src/generators/init/init.ts"],"names":[],"mappings":";;;;AAAA,uCAQoB;AACpB,0DAA4E;AAG5E,mDAI8B;AAE9B,SAAsB,kBAAkB,CAAC,IAAU,EAAE,MAAc;;QACjE,MAAM,KAAK,GAAwB,EAAE,CAAC;QAEtC,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE;YAC3B,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;YACjC,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;SACtC;QAED,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;YACtB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,IAAA,yBAAgB,EAAC,GAAG,KAAK,CAAC,CAAC;IACpC,CAAC;CAAA;AAbD,gDAaC;AAED,SAAgB,kBAAkB,CAAC,IAAU;IAC3C,OAAO,IAAA,qCAA4B,EACjC,IAAI,EACJ,EAAE,EACF;QACE,WAAW,EAAE,oBAAS;QACtB,KAAK,EAAE,uBAAY;QACnB,2BAA2B,EAAE,gCAAqB;QAClD,aAAa,EAAE,2BAAgB;QAC/B,aAAa,EAAE,sBAAW;KAC3B,CACF,CAAC;AACJ,CAAC;AAZD,gDAYC;AAED,SAAS,cAAc,CAAC,IAAU;IAChC,OAAO,IAAA,0CAAiC,EAAC,IAAI,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC;AACpE,CAAC;AAED,kBAAe,kBAAkB,CAAC;AACrB,QAAA,kBAAkB,GAAG,IAAA,2BAAkB,EAAC,kBAAkB,CAAC,CAAC"}
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/detox/src/generators/init/init.ts"],"names":[],"mappings":";;;;AAAA,uCAQoB;AACpB,0DAA4E;AAG5E,mDAK8B;AAE9B,SAAsB,kBAAkB,CAAC,IAAU,EAAE,MAAc;;QACjE,MAAM,KAAK,GAAwB,EAAE,CAAC;QAEtC,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE;YAC3B,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;YACjC,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;SAC9C;QAED,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;YACtB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,IAAA,yBAAgB,EAAC,GAAG,KAAK,CAAC,CAAC;IACpC,CAAC;CAAA;AAbD,gDAaC;AAED,SAAgB,kBAAkB,CAAC,IAAU,EAAE,MAAc;IAC3D,OAAO,IAAA,qCAA4B,EACjC,IAAI,EACJ,EAAE,kBAEA,WAAW,EAAE,oBAAS,EACtB,KAAK,EAAE,uBAAY,EACnB,2BAA2B,EAAE,gCAAqB,EAClD,aAAa,EAAE,2BAAgB,EAC/B,aAAa,EAAE,sBAAW,IACvB,CAAC,MAAM,CAAC,SAAS,KAAK,MAAM;QAC7B,CAAC,CAAC,EAAE,uBAAuB,EAAE,oCAAyB,EAAE;QACxD,CAAC,CAAC,EAAE,CAAC,EAEV,CAAC;AACJ,CAAC;AAfD,gDAeC;AAED,SAAS,cAAc,CAAC,IAAU;IAChC,OAAO,IAAA,0CAAiC,EAAC,IAAI,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC;AACpE,CAAC;AAED,kBAAe,kBAAkB,CAAC;AACrB,QAAA,kBAAkB,GAAG,IAAA,2BAAkB,EAAC,kBAAkB,CAAC,CAAC"}
@@ -15,6 +15,12 @@
15
15
  "default": false,
16
16
  "description": "Do not add dependencies to `package.json`.",
17
17
  "x-priority": "internal"
18
+ },
19
+ "framework": {
20
+ "type": "string",
21
+ "description": "App framework to test",
22
+ "enum": ["react-native", "expo"],
23
+ "default": "react-native"
18
24
  }
19
25
  },
20
26
  "required": []
@@ -5,6 +5,6 @@ import { Tree } from '@nx/devkit';
5
5
  * - update keys: runnerConfig
6
6
  * Update jest.config.json under detox project:
7
7
  * - remove key: transform
8
- * - add key: rootDir, testMatch
8
+ * - add key: rootDir, testMatch, reporter, globalSetup, globalTeardown, verbose
9
9
  */
10
10
  export default function update(tree: Tree): Promise<void>;
@@ -8,14 +8,14 @@ const devkit_1 = require("@nx/devkit");
8
8
  * - update keys: runnerConfig
9
9
  * Update jest.config.json under detox project:
10
10
  * - remove key: transform
11
- * - add key: rootDir, testMatch
11
+ * - add key: rootDir, testMatch, reporter, globalSetup, globalTeardown, verbose
12
12
  */
13
13
  function update(tree) {
14
14
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
15
15
  const projects = (0, devkit_1.getProjects)(tree);
16
16
  projects.forEach((project) => {
17
17
  var _a, _b;
18
- if (((_b = (_a = project.targets) === null || _a === void 0 ? void 0 : _a['test-ios']) === null || _b === void 0 ? void 0 : _b.executor) !== '@nrwl/detox:test')
18
+ if (((_b = (_a = project.targets) === null || _a === void 0 ? void 0 : _a['test-ios']) === null || _b === void 0 ? void 0 : _b.executor) !== '@nx/detox:test')
19
19
  return;
20
20
  updateDetoxrcJson(tree, project);
21
21
  updateJestConfigJson(tree, project);
@@ -61,6 +61,10 @@ function updateJestConfigJson(host, project) {
61
61
  '<rootDir>/src/**/*.spec.ts?(x)',
62
62
  ];
63
63
  }
64
+ json.reporter = ['detox/runners/jest/reporter'];
65
+ json.globalSetup = 'detox/runners/jest/globalSetup';
66
+ json.globalTeardown = 'detox/runners/jest/globalTeardown';
67
+ json.verbose = true;
64
68
  return json;
65
69
  });
66
70
  }
@@ -1 +1 @@
1
- {"version":3,"file":"update-detoxrc-json.js","sourceRoot":"","sources":["../../../../../../packages/detox/src/migrations/update-16-0-0/update-detoxrc-json.ts"],"names":[],"mappings":";;;AAAA,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AA,mBAAU,EAAC,IAAI,EAAE,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE;QACxC,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,OAAO,IAAI,CAAC,SAAS,CAAC;SACvB;QACD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACjB,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;SACpB;QACD,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG;gBACf,gCAAgC;gBAChC,gCAAgC;aACjC,CAAC;SACH;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"update-detoxrc-json.js","sourceRoot":"","sources":["../../../../../../packages/detox/src/migrations/update-16-0-0/update-detoxrc-json.ts"],"names":[],"mappings":";;;AAAA,uCAMoB;AAEpB;;;;;;;GAOG;AACH,SAA8B,MAAM,CAAC,IAAU;;QAC7C,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;;YAC3B,IAAI,CAAA,MAAA,MAAA,OAAO,CAAC,OAAO,0CAAG,UAAU,CAAC,0CAAE,QAAQ,MAAK,gBAAgB;gBAAE,OAAO;YACzE,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACjC,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;QAEH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAVD,yBAUC;AAED,SAAS,iBAAiB,CAAC,IAAU,EAAE,OAA6B;IAClE,MAAM,eAAe,GAAG,GAAG,OAAO,CAAC,IAAI,gBAAgB,CAAC;IACxD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;QAAE,OAAO;IAC1C,IAAA,mBAAU,EAAC,IAAI,EAAE,eAAe,EAAE,CAAC,IAAI,EAAE,EAAE;QACzC,IAAI,CAAC,UAAU,GAAG;YAChB,IAAI,EAAE;gBACJ,EAAE,EAAE,MAAM;gBACV,MAAM,EAAE,oBAAoB;aAC7B;YACD,IAAI,EAAE;gBACJ,YAAY,EAAE,MAAM;aACrB;SACF,CAAC;QACF,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,OAAO,IAAI,CAAC,YAAY,CAAC;SAC1B;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,oBAAoB,CAAC,IAAU,EAAE,OAA6B;IACrE,MAAM,cAAc,GAAG,GAAG,OAAO,CAAC,IAAI,mBAAmB,CAAC;IAC1D,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;QAAE,OAAO;IACzC,IAAA,mBAAU,EAAC,IAAI,EAAE,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE;QACxC,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,OAAO,IAAI,CAAC,SAAS,CAAC;SACvB;QACD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACjB,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;SACpB;QACD,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,IAAI,CAAC,SAAS,GAAG;gBACf,gCAAgC;gBAChC,gCAAgC;aACjC,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,CAAC,6BAA6B,CAAC,CAAC;QAChD,IAAI,CAAC,WAAW,GAAG,gCAAgC,CAAC;QACpD,IAAI,CAAC,cAAc,GAAG,mCAAmC,CAAC;QAC1D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Tree } from '@nx/devkit';
2
+ /**
3
+ * Update .detoxrc.json under detox project for expo:
4
+ * - fix the eas build command
5
+ * - fix the local build command
6
+ * - update project.json targets
7
+ */
8
+ export default function update(tree: Tree): Promise<void>;
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const devkit_1 = require("@nx/devkit");
5
+ /**
6
+ * Update .detoxrc.json under detox project for expo:
7
+ * - fix the eas build command
8
+ * - fix the local build command
9
+ * - update project.json targets
10
+ */
11
+ function update(tree) {
12
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
13
+ const projects = (0, devkit_1.getProjects)(tree);
14
+ projects.forEach((project) => {
15
+ var _a, _b;
16
+ if (((_b = (_a = project.targets) === null || _a === void 0 ? void 0 : _a['test-ios']) === null || _b === void 0 ? void 0 : _b.executor) !== '@nx/detox:test')
17
+ return;
18
+ updateDetoxrcJson(tree, project);
19
+ updateProjectJson(tree, project);
20
+ });
21
+ yield (0, devkit_1.formatFiles)(tree);
22
+ });
23
+ }
24
+ exports.default = update;
25
+ function updateDetoxrcJson(host, project) {
26
+ var _a, _b;
27
+ const detoxConfigPath = `${project.root}/.detoxrc.json`;
28
+ const projectName = ((_a = project.name) === null || _a === void 0 ? void 0 : _a.endsWith('-e2e'))
29
+ ? project.name.substring(0, project.name.indexOf('-e2e'))
30
+ : project.name;
31
+ const appRoot = (_b = (0, devkit_1.getProjects)(host).get(projectName)) === null || _b === void 0 ? void 0 : _b.root;
32
+ const appName = (0, devkit_1.names)(projectName).className;
33
+ const offset = (0, devkit_1.offsetFromRoot)(project.root);
34
+ const exec = (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(host.root)).exec;
35
+ if (!host.exists(detoxConfigPath))
36
+ return;
37
+ (0, devkit_1.updateJson)(host, detoxConfigPath, (json) => {
38
+ var _a, _b, _c, _d;
39
+ if ((_a = json.apps) === null || _a === void 0 ? void 0 : _a['ios.eas']) {
40
+ json.apps['ios.eas'].build = `${exec} nx run ${projectName}:download --platform ios --distribution simulator --output=${offset}${appRoot}/dist/`;
41
+ }
42
+ if ((_b = json.apps) === null || _b === void 0 ? void 0 : _b['android.eas']) {
43
+ json.apps['android.eas'].build = `${exec} nx run ${projectName}:download --platform android --distribution simulator --output=${offset}${appRoot}/dist/`;
44
+ json.apps['android.eas'].type = 'android.apk';
45
+ }
46
+ if ((_c = json.apps) === null || _c === void 0 ? void 0 : _c['ios.local']) {
47
+ json.apps['ios.local'].build = `${exec} nx run ${projectName}:build --platform ios --profile preview --wait --local --no-interactive --output=${offset}${appRoot}/dist/${appName}.tar.gz`;
48
+ }
49
+ if ((_d = json.apps) === null || _d === void 0 ? void 0 : _d['android.local']) {
50
+ json.apps['android.local'].build = `${exec} nx run ${projectName}:build --platform android --profile preview --wait --local --no-interactive --output=${offset}${appRoot}/dist/${appName}.apk`;
51
+ json.apps['android.local'].type = 'android.apk';
52
+ }
53
+ return json;
54
+ });
55
+ }
56
+ function updateProjectJson(host, project) {
57
+ var _a, _b, _c, _d, _e, _f;
58
+ if (((_c = (_b = (_a = project.targets) === null || _a === void 0 ? void 0 : _a['test-ios']) === null || _b === void 0 ? void 0 : _b.options) === null || _c === void 0 ? void 0 : _c.detoxConfiguration) == 'ios.sim.eas') {
59
+ project.targets['build-ios'].options.detoxConfiguration = 'ios.sim.eas';
60
+ }
61
+ if (((_f = (_e = (_d = project.targets) === null || _d === void 0 ? void 0 : _d['test-android']) === null || _e === void 0 ? void 0 : _e.options) === null || _f === void 0 ? void 0 : _f.detoxConfiguration) ==
62
+ 'android.sim.eas') {
63
+ project.targets['build-android'].options.detoxConfiguration =
64
+ 'android.sim.eas';
65
+ project.targets['test-android'] = {
66
+ executor: '@nx/detox:test',
67
+ options: {
68
+ detoxConfiguration: 'android.sim.eas',
69
+ buildTarget: `${project.name}:build-android`,
70
+ },
71
+ configurations: {
72
+ local: {
73
+ detoxConfiguration: 'android.emu.local',
74
+ buildTarget: `${project.name}:build-android:local`,
75
+ },
76
+ bare: {
77
+ detoxConfiguration: 'android.emu.debug',
78
+ buildTarget: `${project.name}:build-android:bare`,
79
+ },
80
+ production: {
81
+ detoxConfiguration: 'android.emu.release',
82
+ buildTarget: `${project.name}:build-android:production`,
83
+ },
84
+ },
85
+ };
86
+ }
87
+ (0, devkit_1.updateProjectConfiguration)(host, project.name, project);
88
+ }
89
+ //# sourceMappingURL=update-detoxrc-json-expo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-detoxrc-json-expo.js","sourceRoot":"","sources":["../../../../../../packages/detox/src/migrations/update-16-1-4/update-detoxrc-json-expo.ts"],"names":[],"mappings":";;;AAAA,uCAWoB;AAEpB;;;;;GAKG;AACH,SAA8B,MAAM,CAAC,IAAU;;QAC7C,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;;YAC3B,IAAI,CAAA,MAAA,MAAA,OAAO,CAAC,OAAO,0CAAG,UAAU,CAAC,0CAAE,QAAQ,MAAK,gBAAgB;gBAAE,OAAO;YACzE,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACjC,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QAEH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAVD,yBAUC;AAED,SAAS,iBAAiB,CAAC,IAAU,EAAE,OAA6B;;IAClE,MAAM,eAAe,GAAG,GAAG,OAAO,CAAC,IAAI,gBAAgB,CAAC;IACxD,MAAM,WAAW,GAAG,CAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,QAAQ,CAAC,MAAM,CAAC;QAChD,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzD,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IACjB,MAAM,OAAO,GAAG,MAAA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CAAC;KACH;IACD,IAAA,mCAA0B,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC1D,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export declare const nxVersion: any;
2
- export declare const detoxVersion = "~20.7.0";
2
+ export declare const detoxVersion = "^20.9.0";
3
3
  export declare const testingLibraryJestDom = "5.16.5";
4
+ export declare const configPluginsDetoxVersion = "~5.0.1";
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.testingLibraryJestDom = exports.detoxVersion = exports.nxVersion = void 0;
3
+ exports.configPluginsDetoxVersion = exports.testingLibraryJestDom = exports.detoxVersion = exports.nxVersion = void 0;
4
4
  exports.nxVersion = require('../../package.json').version;
5
- exports.detoxVersion = '~20.7.0';
5
+ exports.detoxVersion = '^20.9.0';
6
6
  exports.testingLibraryJestDom = '5.16.5';
7
+ exports.configPluginsDetoxVersion = '~5.0.1'; // only required for expo
7
8
  //# sourceMappingURL=versions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/detox/src/utils/versions.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC;AAElD,QAAA,YAAY,GAAG,SAAS,CAAC;AACzB,QAAA,qBAAqB,GAAG,QAAQ,CAAC"}
1
+ {"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/detox/src/utils/versions.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC;AAElD,QAAA,YAAY,GAAG,SAAS,CAAC;AACzB,QAAA,qBAAqB,GAAG,QAAQ,CAAC;AACjC,QAAA,yBAAyB,GAAG,QAAQ,CAAC,CAAC,yBAAyB"}