detox 20.0.11-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.
- package/Detox-android/com/wix/detox/{20.0.11-prerelease.0/detox-20.0.11-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
- 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
- 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
- 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
- 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
- package/Detox-android/com/wix/detox/{20.0.11-prerelease.0/detox-20.0.11-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
- 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
- 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
- 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
- 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
- package/Detox-android/com/wix/detox/{20.0.11-prerelease.0/detox-20.0.11-prerelease.0.aar → 20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.aar} +0 -0
- package/Detox-android/com/wix/detox/{20.0.11-prerelease.0/detox-20.0.11-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
- package/Detox-android/com/wix/detox/{20.0.11-prerelease.0/detox-20.0.11-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
- package/Detox-android/com/wix/detox/{20.0.11-prerelease.0/detox-20.0.11-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
- package/Detox-android/com/wix/detox/{20.0.11-prerelease.0/detox-20.0.11-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
- package/Detox-android/com/wix/detox/{20.0.11-prerelease.0/detox-20.0.11-prerelease.0.pom → 20.1.0-next-is-hittable-check.0/detox-20.1.0-next-is-hittable-check.0.pom} +1 -1
- 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
- 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
- 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
- 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
- package/Detox-android/com/wix/detox/maven-metadata.xml +4 -4
- package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +1 -1
- package/Detox-ios-src.tbz +0 -0
- package/Detox-ios.tbz +0 -0
- package/android/detox/proguard-rules-app.pro +4 -2
- package/index.d.ts +22 -6
- package/internals.d.ts +106 -28
- package/local-cli/cli.js +7 -5
- package/local-cli/init.js +1 -1
- package/local-cli/reset-lock-file.js +16 -0
- package/local-cli/test.js +4 -4
- package/local-cli/test.test.js +85 -37
- package/local-cli/testCommand/TestRunnerCommand.js +45 -30
- package/local-cli/utils/jestInternals.js +4 -1
- package/package.json +3 -3
- package/runners/jest/reporters/DetoxReporter.js +22 -2
- package/runners/jest/testEnvironment/index.js +83 -82
- package/runners/jest/testEnvironment/listeners/DetoxCoreListener.js +9 -24
- package/runners/jest/testEnvironment/listeners/DetoxPlatformFilterListener.js +1 -1
- package/src/DetoxWorker.js +0 -6
- package/src/artifacts/ArtifactsManager.js +0 -18
- package/src/configuration/composeLoggerConfig.js +2 -2
- package/src/configuration/composeRunnerConfig.js +7 -4
- package/src/devices/allocation/drivers/android/emulator/AVDValidator.js +4 -4
- package/src/devices/allocation/drivers/android/emulator/EmulatorAllocDriver.js +1 -1
- package/src/ipc/IPCClient.js +9 -5
- package/src/ipc/IPCServer.js +17 -13
- package/src/ipc/SessionState.js +3 -5
- package/src/logger/DetoxLogger.js +4 -6
- package/src/realms/DetoxContext.js +2 -8
- package/src/realms/DetoxInternalsFacade.js +1 -1
- package/src/realms/DetoxPrimaryContext.js +6 -8
- package/src/realms/DetoxSecondaryContext.js +2 -2
- package/src/symbols.js +2 -14
- package/src/utils/Timer.js +55 -38
- package/src/utils/errorUtils.js +20 -0
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0-javadoc.jar.md5 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0-javadoc.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0-javadoc.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0-javadoc.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0-sources.jar.md5 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0-sources.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0-sources.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0-sources.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0.pom.md5 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0.pom.sha1 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0.pom.sha256 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0.pom.sha512 +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
3f9aa853e15bb15aa9558ac3d2b7252f
|
@@ -0,0 +1 @@
|
|
1
|
+
f1dd211a2bbbe503be2e90573c9aa465d39f029e
|
@@ -0,0 +1 @@
|
|
1
|
+
251b43c4d9cac5fbae87a75c015c577257212beb1c9a0ab294981f8d12310019
|
@@ -0,0 +1 @@
|
|
1
|
+
08cc04feb00bd8b233b990b7127b42af544865adf28b2cb57601c791d313672f0dbe20c5673d393395edeb970d8d11127c7eb098add143b13b044a62999d60a9
|
@@ -0,0 +1 @@
|
|
1
|
+
24df5a9831b657b7ebb686b3677bdd78
|
@@ -0,0 +1 @@
|
|
1
|
+
996291301615fc1a37a2a3cea94459b0d315864f
|
@@ -0,0 +1 @@
|
|
1
|
+
ebd8dbf8bb38883b6988fd82932ce0a09f287e13501ec31d80677abe8c077589
|
@@ -0,0 +1 @@
|
|
1
|
+
35852565ad133c30234f00c3e518761068bf749a47e7c600e768b6b9756e76ed5fe40bfb139d5cdce27f30b9b76792c8cc2218f7086b39e68ac4658609eb75a5
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -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
|
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
|
+
185b91e2be7cfaeaf995b7ca85cefe7b
|
@@ -0,0 +1 @@
|
|
1
|
+
e4cd532fd4f1339057ffe02814349398e9dc1a49
|
@@ -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
|
7
|
-
<release>20.0
|
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
|
9
|
+
<version>20.1.0-next-is-hittable-check.0</version>
|
10
10
|
</versions>
|
11
|
-
<lastUpdated>
|
11
|
+
<lastUpdated>20221027091848</lastUpdated>
|
12
12
|
</versioning>
|
13
13
|
</metadata>
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
6abc81d3b72724caa7b05b479ec9cda4
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
e5c15d3ad5f2372b8c9131eb4f9c431c34b534d6
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2bef8053b1c66b74321c2f2cc0c6f74bf2d3af4205804b5bab79e8417fc6d186
|
@@ -1 +1 @@
|
|
1
|
-
|
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
|
12
|
-
-keep class com.
|
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
@@ -11,6 +11,7 @@
|
|
11
11
|
import { BunyanDebugStreamOptions } from 'bunyan-debug-stream';
|
12
12
|
|
13
13
|
declare global {
|
14
|
+
const detox: Detox.DetoxExportWrapper;
|
14
15
|
const device: Detox.DetoxExportWrapper['device'];
|
15
16
|
const element: Detox.DetoxExportWrapper['element'];
|
16
17
|
const waitFor: Detox.DetoxExportWrapper['waitFor'];
|
@@ -20,6 +21,7 @@ declare global {
|
|
20
21
|
|
21
22
|
namespace NodeJS {
|
22
23
|
interface Global {
|
24
|
+
detox: Detox.DetoxExportWrapper;
|
23
25
|
device: Detox.DetoxExportWrapper['device'];
|
24
26
|
element: Detox.DetoxExportWrapper['element'];
|
25
27
|
waitFor: Detox.DetoxExportWrapper['waitFor'];
|
@@ -103,9 +105,9 @@ declare global {
|
|
103
105
|
interface DetoxLoggerConfig {
|
104
106
|
level?: DetoxLogLevel;
|
105
107
|
/**
|
106
|
-
* @default
|
108
|
+
* @default true
|
107
109
|
*/
|
108
|
-
overrideConsole?:
|
110
|
+
overrideConsole?: boolean;
|
109
111
|
options?: BunyanDebugStreamOptions | ((config: Partial<DetoxLoggerConfig>) => BunyanDebugStreamOptions);
|
110
112
|
}
|
111
113
|
|
@@ -137,9 +139,13 @@ declare global {
|
|
137
139
|
*/
|
138
140
|
jest?: {
|
139
141
|
/**
|
140
|
-
*
|
142
|
+
* Environment setup timeout
|
143
|
+
*/
|
144
|
+
setupTimeout?: number | undefined;
|
145
|
+
/**
|
146
|
+
* Environment teardown timeout
|
141
147
|
*/
|
142
|
-
|
148
|
+
teardownTimeout?: number | undefined;
|
143
149
|
/**
|
144
150
|
* Insist on CLI-based retry mechanism even when the failed tests have been handled
|
145
151
|
* by jest.retryTimes(n) mechanism from Jest Circus.
|
@@ -152,11 +158,21 @@ declare global {
|
|
152
158
|
* Retries count. Zero means a single attempt to run tests.
|
153
159
|
*/
|
154
160
|
retries?: number;
|
161
|
+
/**
|
162
|
+
* When true, tells Detox CLI to cancel next retrying if it gets
|
163
|
+
* at least one report about a permanent test suite failure.
|
164
|
+
* Has no effect, if {@link DetoxTestRunnerConfig#retries} is
|
165
|
+
* undefined or set to zero.
|
166
|
+
*
|
167
|
+
* @default false
|
168
|
+
* @see {DetoxInternals.DetoxTestFileReport#isPermanentFailure}
|
169
|
+
*/
|
170
|
+
bail?: boolean;
|
155
171
|
/**
|
156
172
|
* Custom handler to process --inspect-brk CLI flag.
|
157
|
-
* 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.
|
158
174
|
*/
|
159
|
-
inspectBrk?:
|
175
|
+
inspectBrk?: (config: DetoxTestRunnerConfig) => void;
|
160
176
|
/**
|
161
177
|
* Forward environment variables to the spawned test runner
|
162
178
|
* accordingly to the given CLI argument overrides.
|
package/internals.d.ts
CHANGED
@@ -40,28 +40,80 @@ declare global {
|
|
40
40
|
// endregion
|
41
41
|
|
42
42
|
// region Lifecycle
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
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>;
|
108
|
+
|
109
|
+
/**
|
110
|
+
* Reports to Detox CLI about passed and failed test files.
|
111
|
+
* The failed test files might be re-run again if
|
58
112
|
* {@link Detox.DetoxTestRunnerConfig#retries} is set to a non-zero.
|
59
113
|
*
|
60
|
-
* @param
|
61
|
-
* @param permanent whether the failure is permanent, and the tests
|
62
|
-
* should not be re-run.
|
114
|
+
* @param testResults - reports about test files
|
63
115
|
*/
|
64
|
-
|
116
|
+
reportTestResults(testResults: DetoxTestFileReport[]): Promise<void>;
|
65
117
|
// endregion
|
66
118
|
|
67
119
|
readonly config: RuntimeConfig;
|
@@ -88,11 +140,14 @@ declare global {
|
|
88
140
|
|
89
141
|
type DetoxInitOptions = {
|
90
142
|
cwd: string;
|
143
|
+
/**
|
144
|
+
* @internal
|
145
|
+
*/
|
91
146
|
argv: Record<string, unknown>;
|
92
147
|
testRunnerArgv: Record<string, unknown>;
|
93
148
|
override: Partial<Detox.DetoxConfig>;
|
94
149
|
/** @inheritDoc */
|
95
|
-
global: NodeJS.Global;
|
150
|
+
global: NodeJS.Global | {};
|
96
151
|
/**
|
97
152
|
* Worker ID. Used to distinguish allocated workers in parallel test execution environment.
|
98
153
|
*
|
@@ -111,7 +166,7 @@ declare global {
|
|
111
166
|
* {@link DetoxInternals.Facade#setup} might override {@link Console} methods
|
112
167
|
* to integrate it with Detox loggeing subsystem.
|
113
168
|
*/
|
114
|
-
global: NodeJS.Global;
|
169
|
+
global: NodeJS.Global | {};
|
115
170
|
/**
|
116
171
|
* Worker ID. Used to distinguish allocated workers in parallel test execution environment.
|
117
172
|
*
|
@@ -120,25 +175,48 @@ declare global {
|
|
120
175
|
workerId: string;
|
121
176
|
};
|
122
177
|
|
178
|
+
type DetoxTestFileReport = {
|
179
|
+
/**
|
180
|
+
* Global or relative path to the failed test file.
|
181
|
+
*/
|
182
|
+
testFilePath: string;
|
183
|
+
/**
|
184
|
+
* Whether the test passed or not.
|
185
|
+
*/
|
186
|
+
success: boolean;
|
187
|
+
/**
|
188
|
+
* Top-level error if the entire test file failed.
|
189
|
+
*/
|
190
|
+
testExecError?: { name?: string; message: string; stack?: string; };
|
191
|
+
/**
|
192
|
+
* If the test failed, it should tell whether the failure is permanent.
|
193
|
+
* Permanent failure means that the test file should not be re-run.
|
194
|
+
*
|
195
|
+
* @default false
|
196
|
+
* @see {Detox.DetoxTestRunnerConfig#retries}
|
197
|
+
*/
|
198
|
+
isPermanentFailure?: boolean;
|
199
|
+
};
|
200
|
+
|
123
201
|
type SessionState = Readonly<{
|
124
202
|
/**
|
125
203
|
* Randomly generated ID for the entire Detox test session, including retries.
|
126
204
|
*/
|
127
205
|
id: string;
|
128
206
|
/**
|
129
|
-
*
|
130
|
-
*/
|
131
|
-
failedTestFiles: string[];
|
132
|
-
/**
|
133
|
-
* Failed test file paths suggested to retry via Detox CLI mechanism.
|
207
|
+
* Results of test file executions. Primarily used for Detox CLI retry mechanism.
|
134
208
|
*/
|
135
|
-
|
209
|
+
testResults: DetoxTestFileReport[];
|
136
210
|
/**
|
137
211
|
* Retry index of the test session: 0..retriesCount.
|
138
212
|
*/
|
139
213
|
testSessionIndex: number;
|
140
214
|
/**
|
141
|
-
*
|
215
|
+
* Count of Detox contexts with a worker installed.
|
216
|
+
* Oversimplified, it reflects the count of allocated devices in the current test session.
|
217
|
+
*
|
218
|
+
* @see {Facade#init}
|
219
|
+
* @see {Facade#installWorker}
|
142
220
|
*/
|
143
221
|
workersCount: number;
|
144
222
|
}>;
|
package/local-cli/cli.js
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
+
const fs = require('fs');
|
3
|
+
|
4
|
+
const _ = require('lodash');
|
2
5
|
const yargs = require('yargs');
|
3
6
|
|
7
|
+
const logger = require('../internals').log.child({ cat: 'cli' });
|
4
8
|
const DetoxError = require('../src/errors/DetoxError');
|
5
|
-
const logger = require('../src/utils/logger').child({ cat: 'cli' });
|
6
9
|
|
7
10
|
yargs
|
8
11
|
.scriptName('detox')
|
@@ -25,12 +28,11 @@ yargs
|
|
25
28
|
.wrap(yargs.terminalWidth() * 0.9)
|
26
29
|
.fail(function(msg, err, program) {
|
27
30
|
if (err) {
|
28
|
-
|
29
|
-
for (const line of lines) {
|
30
|
-
logger.error(line);
|
31
|
-
}
|
31
|
+
logger.error(DetoxError.format(err));
|
32
32
|
// eslint-disable-next-line no-console
|
33
33
|
console.error('');
|
34
|
+
// @ts-ignore
|
35
|
+
_.attempt(() => fs.unlinkSync(logger.file));
|
34
36
|
// eslint-disable-next-line no-process-exit
|
35
37
|
process.exit(1);
|
36
38
|
}
|
package/local-cli/init.js
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
const { log } = require('../internals');
|
2
|
+
const DeviceRegistry = require('../src/devices/DeviceRegistry');
|
3
|
+
const { getDetoxLibraryRootPath } = require('../src/utils/environment');
|
4
|
+
|
5
|
+
|
6
|
+
module.exports.command = 'reset-lock-file';
|
7
|
+
module.exports.desc = 'Resets all Detox lock files. Useful when you need to run multiple `detox test` commands in parallel with --keepLockFile.';
|
8
|
+
|
9
|
+
module.exports.handler = async function resetLockFile() {
|
10
|
+
await Promise.all([
|
11
|
+
DeviceRegistry.forIOS().reset(),
|
12
|
+
DeviceRegistry.forAndroid().reset(),
|
13
|
+
]);
|
14
|
+
|
15
|
+
log.info(`Cleaned lock files from: ${getDetoxLibraryRootPath()}`);
|
16
|
+
};
|
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 (!
|
19
|
+
if (!detoxArgs['inspect-brk']) {
|
20
20
|
await detox.init(opts);
|
21
21
|
}
|
22
22
|
|
23
23
|
const runnerCommand = new TestRunnerCommand()
|
24
|
-
.setDeviceConfig(
|
25
|
-
.replicateCLIConfig(
|
26
|
-
.setRunnerConfig(
|
24
|
+
.setDeviceConfig(config.device)
|
25
|
+
.replicateCLIConfig(config.cli)
|
26
|
+
.setRunnerConfig(config.testRunner);
|
27
27
|
|
28
28
|
await runnerCommand.execute();
|
29
29
|
} finally {
|