detox 19.13.0 → 20.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/Detox-android/com/wix/detox/{19.13.0/detox-19.13.0-javadoc.jar → 20.0.0/detox-20.0.0-javadoc.jar} +0 -0
- package/Detox-android/com/wix/detox/20.0.0/detox-20.0.0-javadoc.jar.md5 +1 -0
- package/Detox-android/com/wix/detox/20.0.0/detox-20.0.0-javadoc.jar.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.0.0/detox-20.0.0-javadoc.jar.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.0.0/detox-20.0.0-javadoc.jar.sha512 +1 -0
- package/Detox-android/com/wix/detox/{19.13.0/detox-19.13.0-sources.jar → 20.0.0/detox-20.0.0-sources.jar} +0 -0
- package/Detox-android/com/wix/detox/20.0.0/detox-20.0.0-sources.jar.md5 +1 -0
- package/Detox-android/com/wix/detox/20.0.0/detox-20.0.0-sources.jar.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.0.0/detox-20.0.0-sources.jar.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.0.0/detox-20.0.0-sources.jar.sha512 +1 -0
- package/Detox-android/com/wix/detox/20.0.0/detox-20.0.0.aar +0 -0
- package/Detox-android/com/wix/detox/20.0.0/detox-20.0.0.aar.md5 +1 -0
- package/Detox-android/com/wix/detox/20.0.0/detox-20.0.0.aar.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.0.0/detox-20.0.0.aar.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.0.0/detox-20.0.0.aar.sha512 +1 -0
- package/Detox-android/com/wix/detox/{19.13.0/detox-19.13.0.pom → 20.0.0/detox-20.0.0.pom} +1 -1
- package/Detox-android/com/wix/detox/20.0.0/detox-20.0.0.pom.md5 +1 -0
- package/Detox-android/com/wix/detox/20.0.0/detox-20.0.0.pom.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.0.0/detox-20.0.0.pom.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.0.0/detox-20.0.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/README.md +1 -1
- package/android/detox/src/full/java/com/wix/detox/Detox.java +2 -59
- package/android/detox/src/full/java/com/wix/detox/NotificationDataParser.kt +3 -3
- package/index.d.ts +354 -191
- package/index.js +1 -0
- package/internals.d.ts +298 -0
- package/internals.js +4 -0
- package/local-cli/build-framework-cache.js +2 -2
- package/local-cli/build.js +7 -8
- package/local-cli/build.test.js +46 -40
- package/local-cli/clean-framework-cache.js +3 -3
- package/local-cli/cli.js +8 -7
- package/local-cli/init.js +73 -68
- package/local-cli/rebuild-framework-cache.js +1 -1
- package/local-cli/reset-lock-file.js +16 -0
- package/local-cli/templates/jest.js +14 -36
- package/local-cli/test.js +24 -282
- package/local-cli/test.test.js +394 -648
- package/local-cli/testCommand/TestRunnerCommand.js +163 -0
- package/local-cli/{utils/testCommandArgs.js → testCommand/builder.js} +10 -36
- package/local-cli/testCommand/middlewares.js +66 -0
- package/local-cli/{utils → testCommand}/warnings.js +0 -13
- package/local-cli/utils/jestInternals.js +13 -2
- package/local-cli/utils/yargsUtils.js +67 -0
- package/package.json +32 -19
- package/runners/deprecation.js +45 -0
- package/runners/jest/JestCircusEnvironment.js +3 -38
- package/runners/jest/adapter.d.ts +4 -10
- package/runners/jest/adapter.js +3 -6
- package/runners/jest/assignReporter.d.ts +4 -1
- package/runners/jest/assignReporter.js +3 -6
- package/runners/jest/globalSetup.js +1 -0
- package/runners/jest/globalTeardown.js +1 -0
- package/runners/jest/index.d.ts +60 -0
- package/runners/jest/index.js +16 -0
- package/runners/jest/index.test.js +13 -0
- package/runners/jest/reporter.js +1 -0
- package/runners/jest/reporters/DetoxReporter.js +36 -0
- package/runners/jest/specReporter.d.ts +4 -9
- package/runners/jest/specReporter.js +3 -10
- package/runners/jest/streamlineReporter.js +3 -22
- package/runners/jest/testEnvironment/index.js +205 -0
- package/runners/jest/testEnvironment/listeners/DetoxCoreListener.js +166 -0
- package/runners/{jest-circus → jest/testEnvironment}/listeners/DetoxInitErrorListener.js +1 -1
- package/runners/jest/testEnvironment/listeners/DetoxPlatformFilterListener.js +27 -0
- package/runners/jest/{SpecReporterImpl.js → testEnvironment/listeners/SpecReporter.js} +61 -9
- package/runners/jest/testEnvironment/listeners/WorkerAssignReporter.js +30 -0
- package/runners/jest/testEnvironment/listeners/index.js +13 -0
- package/runners/{jest-circus → jest/testEnvironment}/utils/assertExistingContext.js +2 -2
- package/runners/jest/testEnvironment/utils/assertJestCircus27.js +70 -0
- package/runners/jest/testEnvironment/utils/assertJestCircus27.test.js +22 -0
- package/runners/jest/{utils → testEnvironment/utils}/getFullTestName.js +0 -0
- package/runners/jest/{utils → testEnvironment/utils}/hasTimedOut.js +0 -0
- package/runners/jest/{utils → testEnvironment/utils}/index.js +0 -0
- package/runners/jest/{utils → testEnvironment/utils}/stdout.js +0 -0
- package/runners/jest-circus/environment/index.js +6 -0
- package/runners/jest-circus/index.js +1 -10
- package/runners/jest-circus/reporter.js +1 -0
- package/runners/migration.js +37 -0
- package/runners/mocha/DetoxMochaAdapter.js +3 -35
- package/runners/mocha/adapter.d.ts +4 -7
- package/runners/mocha/adapter.js +3 -5
- package/src/DetoxWorker.js +327 -0
- package/src/android/interactions/native.js +2 -1
- package/src/artifacts/ArtifactsManager.js +51 -35
- package/src/artifacts/instruments/ios/SimulatorInstrumentsRecording.js +3 -3
- package/src/artifacts/log/ios/SimulatorLogRecording.js +1 -1
- package/src/artifacts/providers/index.js +0 -4
- package/src/artifacts/screenshot/SimulatorScreenshotPlugin.js +1 -1
- package/src/artifacts/templates/artifact/Artifact.js +1 -1
- package/src/artifacts/templates/plugin/ArtifactPlugin.js +1 -1
- package/src/artifacts/utils/buildDefaultArtifactsRootDirpath.js +2 -4
- package/src/artifacts/utils/temporaryPath.js +18 -5
- package/src/artifacts/video/SimulatorRecordVideoPlugin.js +1 -1
- package/src/client/AsyncWebSocket.js +8 -17
- package/src/client/Client.js +1 -1
- package/src/client/actions/actions.js +2 -2
- package/src/configuration/collectCliConfig.js +3 -16
- package/src/configuration/composeAppsConfig.js +12 -66
- package/src/configuration/composeArtifactsConfig.js +6 -32
- package/src/configuration/composeBehaviorConfig.js +3 -13
- package/src/configuration/composeDeviceConfig.js +38 -63
- package/src/configuration/composeLoggerConfig.js +59 -0
- package/src/configuration/composeRunnerConfig.js +127 -14
- package/src/configuration/composeSessionConfig.js +1 -3
- package/src/configuration/index.js +36 -30
- package/src/configuration/loadExternalConfig.js +1 -1
- package/src/configuration/utils/deviceAppTypes.js +0 -1
- package/src/devices/allocation/DeviceAllocator.js +4 -2
- package/src/devices/allocation/drivers/android/emulator/AVDValidator.js +1 -1
- package/src/devices/allocation/drivers/android/emulator/EmulatorAllocDriver.js +5 -3
- package/src/devices/allocation/drivers/android/emulator/EmulatorAllocationHelper.js +1 -1
- package/src/devices/allocation/drivers/android/emulator/EmulatorLauncher.js +3 -5
- package/src/devices/allocation/drivers/android/emulator/EmulatorVersionResolver.js +4 -6
- package/src/devices/allocation/drivers/android/emulator/launchEmulatorProcess.js +1 -1
- package/src/devices/allocation/drivers/android/genycloud/GenyInstanceAllocationHelper.js +1 -1
- package/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js +1 -1
- package/src/devices/allocation/drivers/ios/SimulatorLauncher.js +3 -3
- package/src/devices/allocation/factories/index.js +0 -1
- package/src/devices/common/drivers/DeviceLauncher.js +2 -2
- package/src/devices/common/drivers/android/emulator/exec/EmulatorExec.js +1 -1
- package/src/devices/common/drivers/android/genycloud/services/GenyInstanceNaming.js +4 -9
- package/src/devices/common/drivers/android/genycloud/services/GenyRecipesService.js +1 -1
- package/src/devices/common/drivers/android/tools/EmulatorTelnet.js +1 -1
- package/src/devices/common/drivers/android/tools/FreeDeviceFinder.js +1 -1
- package/src/devices/common/drivers/ios/tools/AppleSimUtils.js +35 -10
- package/src/devices/lifecycle/GenyGlobalLifecycleHandler.js +13 -15
- package/src/devices/runtime/RuntimeDevice.js +85 -86
- package/src/devices/runtime/drivers/DeviceDriverBase.js +1 -1
- package/src/devices/runtime/drivers/android/AndroidDriver.js +3 -3
- package/src/devices/runtime/drivers/index.js +0 -1
- package/src/devices/runtime/drivers/ios/SimulatorDriver.js +4 -3
- package/src/devices/runtime/factories/ios.js +1 -8
- package/src/devices/runtime/utils/LaunchArgsEditor.js +4 -59
- package/src/devices/runtime/utils/Storage.js +4 -0
- package/src/environmentFactory.js +0 -8
- package/src/errors/DetoxConfigErrorComposer.js +92 -30
- package/src/errors/DetoxError.js +4 -0
- package/src/errors/DetoxRuntimeError.js +5 -5
- package/src/errors/index.js +2 -0
- package/src/ios/expectTwo.js +2 -1
- package/src/ipc/IPCClient.js +117 -0
- package/src/ipc/IPCServer.js +98 -0
- package/src/ipc/SessionState.js +62 -0
- package/src/logger/DetoxLogger.js +348 -0
- package/src/logger/index.js +5 -0
- package/src/logger/utils/BunyanLogger.js +76 -0
- package/src/logger/utils/CategoryThreadDispatcher.js +36 -0
- package/src/logger/utils/DetoxLogFinalizer.js +140 -0
- package/src/logger/utils/MessageStack.js +24 -0
- package/src/logger/utils/ThreadDispatcher.js +61 -0
- package/src/{utils → logger/utils}/customConsoleLogger.js +5 -4
- package/src/logger/utils/sanitizeBunyanContext.js +30 -0
- package/src/logger/utils/streamUtils.js +248 -0
- package/src/logger/utils/tracerLegacy.js +37 -0
- package/src/realms/DetoxConstants.js +13 -0
- package/src/realms/DetoxContext.js +183 -0
- package/src/realms/DetoxInternalsFacade.js +31 -0
- package/src/realms/DetoxPrimaryContext.js +261 -0
- package/src/realms/DetoxSecondaryContext.js +91 -0
- package/src/realms/index.js +10 -0
- package/src/realms/primary.js +3 -0
- package/src/realms/secondary.js +3 -0
- package/src/server/DetoxConnection.js +18 -23
- package/src/server/DetoxServer.js +7 -10
- package/src/server/DetoxSession.js +6 -6
- package/src/server/DetoxSessionManager.js +1 -1
- package/src/server/handlers/RegisteredConnectionHandler.js +1 -2
- package/src/symbols.js +50 -0
- package/src/utils/Timer.js +58 -33
- package/src/utils/argparse.js +11 -0
- package/src/utils/childProcess/exec.js +1 -1
- package/src/utils/childProcess/spawn.js +1 -1
- package/{local-cli/utils/misc.js → src/utils/envUtils.js} +0 -9
- package/src/utils/errorUtils.js +20 -0
- package/src/utils/logger.js +2 -162
- package/src/utils/shellUtils.js +18 -0
- package/src/utils/traceInvocationCall.js +21 -0
- package/src/utils/traceMethods.js +15 -0
- package/Detox-android/com/wix/detox/19.13.0/detox-19.13.0-javadoc.jar.md5 +0 -1
- package/Detox-android/com/wix/detox/19.13.0/detox-19.13.0-javadoc.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox/19.13.0/detox-19.13.0-javadoc.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox/19.13.0/detox-19.13.0-javadoc.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox/19.13.0/detox-19.13.0-sources.jar.md5 +0 -1
- package/Detox-android/com/wix/detox/19.13.0/detox-19.13.0-sources.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox/19.13.0/detox-19.13.0-sources.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox/19.13.0/detox-19.13.0-sources.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox/19.13.0/detox-19.13.0.aar +0 -0
- package/Detox-android/com/wix/detox/19.13.0/detox-19.13.0.aar.md5 +0 -1
- package/Detox-android/com/wix/detox/19.13.0/detox-19.13.0.aar.sha1 +0 -1
- package/Detox-android/com/wix/detox/19.13.0/detox-19.13.0.aar.sha256 +0 -1
- package/Detox-android/com/wix/detox/19.13.0/detox-19.13.0.aar.sha512 +0 -1
- package/Detox-android/com/wix/detox/19.13.0/detox-19.13.0.pom.md5 +0 -1
- package/Detox-android/com/wix/detox/19.13.0/detox-19.13.0.pom.sha1 +0 -1
- package/Detox-android/com/wix/detox/19.13.0/detox-19.13.0.pom.sha256 +0 -1
- package/Detox-android/com/wix/detox/19.13.0/detox-19.13.0.pom.sha512 +0 -1
- package/local-cli/templates/mocha.js +0 -32
- package/local-cli/utils/splitArgv.js +0 -107
- package/runners/integration.js +0 -16
- package/runners/jest/DetoxAdapterCircus.js +0 -60
- package/runners/jest/DetoxAdapterImpl.js +0 -81
- package/runners/jest/DetoxAdapterJasmine.js +0 -67
- package/runners/jest/DetoxStreamlineJestReporter.js +0 -98
- package/runners/jest/FailingTestsReporter.js +0 -16
- package/runners/jest/SpecReporterCircus.js +0 -51
- package/runners/jest/SpecReporterJasmine.js +0 -39
- package/runners/jest/WorkerAssignReporterCircus.js +0 -17
- package/runners/jest/WorkerAssignReporterImpl.js +0 -21
- package/runners/jest/WorkerAssignReporterJasmine.js +0 -15
- package/runners/jest/runnerInfo.js +0 -9
- package/runners/jest-circus/environment.js +0 -206
- package/runners/jest-circus/listeners/DetoxCoreListener.js +0 -113
- package/runners/jest-circus/utils/assertJestCircus26.js +0 -39
- package/runners/jest-circus/utils/wrapErrorWithNoopLifecycle.js +0 -14
- package/src/Detox.js +0 -317
- package/src/DetoxConstants.js +0 -13
- package/src/DetoxExportWrapper.js +0 -140
- package/src/artifacts/timeline/TimelineArtifactPlugin.js +0 -92
- package/src/configuration/utils/warnings.js +0 -12
- package/src/devices/allocation/drivers/NoneAllocDriver.js +0 -10
- package/src/devices/allocation/factories/none.js +0 -11
- package/src/index.js +0 -6
- package/src/utils/ChromeTracingExporter.js +0 -54
- package/src/utils/MissingDetox.js +0 -78
- package/src/utils/fakeTimestampsProvider.js +0 -9
- package/src/utils/getWorkerId.js +0 -5
- package/src/utils/lastFailedTests.js +0 -38
- package/src/utils/sh.js +0 -18
- package/src/utils/trace.js +0 -96
@@ -0,0 +1,163 @@
|
|
1
|
+
const cp = require('child_process');
|
2
|
+
|
3
|
+
const _ = require('lodash');
|
4
|
+
const parser = require('yargs-parser');
|
5
|
+
const unparse = require('yargs-unparser');
|
6
|
+
|
7
|
+
const detox = require('../../internals');
|
8
|
+
const log = detox.log.child({ cat: ['lifecycle', 'cli'] });
|
9
|
+
const { DetoxRuntimeError } = require('../../src/errors');
|
10
|
+
const { printEnvironmentVariables, prependNodeModulesBinToPATH } = require('../../src/utils/envUtils');
|
11
|
+
const { escapeSpaces } = require('../../src/utils/shellUtils');
|
12
|
+
|
13
|
+
class TestRunnerCommand {
|
14
|
+
/*
|
15
|
+
@param {object} opts
|
16
|
+
@param {DetoxInternals.RuntimeConfig} opts.config
|
17
|
+
@param {ProcessEnv} opts.env
|
18
|
+
*/
|
19
|
+
constructor(opts) {
|
20
|
+
const cliConfig = opts.config.cli;
|
21
|
+
const deviceConfig = opts.config.device;
|
22
|
+
const runnerConfig = opts.config.testRunner;
|
23
|
+
|
24
|
+
this._argv = runnerConfig.args;
|
25
|
+
this._retries = runnerConfig.retries;
|
26
|
+
this._envHint = this._buildEnvHint(opts.env);
|
27
|
+
this._envFwd = {};
|
28
|
+
if (runnerConfig.forwardEnv) {
|
29
|
+
this._envFwd = this._buildEnvOverride(cliConfig, deviceConfig);
|
30
|
+
Object.assign(this._envHint, this._envFwd);
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
async execute() {
|
35
|
+
let runsLeft = 1 + this._retries;
|
36
|
+
let launchError = null;
|
37
|
+
|
38
|
+
do {
|
39
|
+
try {
|
40
|
+
await this._spawnTestRunner();
|
41
|
+
launchError = null;
|
42
|
+
} catch (e) {
|
43
|
+
launchError = e;
|
44
|
+
|
45
|
+
const failedTestFiles = detox.session.testResults.filter(r => !r.success);
|
46
|
+
|
47
|
+
const { bail } = detox.config.testRunner;
|
48
|
+
if (bail && failedTestFiles.some(r => r.isPermanentFailure)) {
|
49
|
+
throw e;
|
50
|
+
}
|
51
|
+
|
52
|
+
const testFilesToRetry = failedTestFiles.filter(r => !r.isPermanentFailure).map(r => r.testFilePath);
|
53
|
+
if (_.isEmpty(testFilesToRetry)) {
|
54
|
+
throw e;
|
55
|
+
}
|
56
|
+
|
57
|
+
if (--runsLeft > 0) {
|
58
|
+
// @ts-ignore
|
59
|
+
detox.session.testSessionIndex++; // it is always the primary context, so we can update it
|
60
|
+
this._argv._ = testFilesToRetry;
|
61
|
+
this._logRelaunchError();
|
62
|
+
}
|
63
|
+
}
|
64
|
+
} while (launchError && runsLeft > 0);
|
65
|
+
|
66
|
+
if (launchError) {
|
67
|
+
throw launchError;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
_buildEnvHint(env) {
|
72
|
+
return _(env)
|
73
|
+
.mapKeys((_value, key) => key.toUpperCase())
|
74
|
+
.pickBy((_value, key) => key.startsWith('DETOX_'))
|
75
|
+
.omit(['DETOX_CONFIG_SNAPSHOT_PATH'])
|
76
|
+
.value();
|
77
|
+
}
|
78
|
+
|
79
|
+
/**
|
80
|
+
* @param {DetoxInternals.CLIConfig} cliConfig
|
81
|
+
* @param {Detox.DetoxDeviceConfig} deviceConfig
|
82
|
+
*/
|
83
|
+
_buildEnvOverride(cliConfig, deviceConfig) {
|
84
|
+
return _.omitBy({
|
85
|
+
DETOX_APP_LAUNCH_ARGS: cliConfig.appLaunchArgs,
|
86
|
+
DETOX_ARTIFACTS_LOCATION: cliConfig.artifactsLocation,
|
87
|
+
DETOX_CAPTURE_VIEW_HIERARCHY: cliConfig.captureViewHierarchy,
|
88
|
+
DETOX_CLEANUP: cliConfig.cleanup,
|
89
|
+
DETOX_CONFIGURATION: cliConfig.configuration,
|
90
|
+
DETOX_CONFIG_PATH: cliConfig.configPath,
|
91
|
+
DETOX_DEBUG_SYNCHRONIZATION: cliConfig.debugSynchronization,
|
92
|
+
DETOX_DEVICE_BOOT_ARGS: cliConfig.deviceBootArgs,
|
93
|
+
DETOX_DEVICE_NAME: cliConfig.deviceName,
|
94
|
+
DETOX_FORCE_ADB_INSTALL: deviceConfig.type.startsWith('android.')
|
95
|
+
? cliConfig.forceAdbInstall
|
96
|
+
: undefined,
|
97
|
+
DETOX_GPU: cliConfig.gpu,
|
98
|
+
DETOX_HEADLESS: cliConfig.headless,
|
99
|
+
DETOX_KEEP_LOCKFILE: cliConfig.keepLockFile,
|
100
|
+
DETOX_LOGLEVEL: cliConfig.loglevel,
|
101
|
+
DETOX_READ_ONLY_EMU: cliConfig.readonlyEmu,
|
102
|
+
DETOX_RECORD_LOGS: cliConfig.recordLogs,
|
103
|
+
DETOX_RECORD_PERFORMANCE: cliConfig.recordPerformance,
|
104
|
+
DETOX_RECORD_VIDEOS: cliConfig.recordVideos,
|
105
|
+
DETOX_REPORT_SPECS: cliConfig.jestReportSpecs,
|
106
|
+
DETOX_RETRIES: cliConfig.retries,
|
107
|
+
DETOX_REUSE: cliConfig.reuse,
|
108
|
+
DETOX_TAKE_SCREENSHOTS: cliConfig.takeScreenshots,
|
109
|
+
DETOX_USE_CUSTOM_LOGGER: cliConfig.useCustomLogger,
|
110
|
+
}, _.isUndefined);
|
111
|
+
}
|
112
|
+
|
113
|
+
async _spawnTestRunner() {
|
114
|
+
const fullCommand = this._buildSpawnArguments().map(escapeSpaces);
|
115
|
+
const fullCommandWithHint = printEnvironmentVariables(this._envHint) + fullCommand.join(' ');
|
116
|
+
|
117
|
+
log.info({ env: this._envHint }, fullCommandWithHint);
|
118
|
+
|
119
|
+
return new Promise((resolve, reject) => {
|
120
|
+
cp.spawn(fullCommand[0], fullCommand.slice(1), {
|
121
|
+
shell: true,
|
122
|
+
stdio: 'inherit',
|
123
|
+
env: _({})
|
124
|
+
.assign(process.env)
|
125
|
+
.assign(this._envFwd)
|
126
|
+
.omitBy(_.isUndefined)
|
127
|
+
.tap(prependNodeModulesBinToPATH)
|
128
|
+
.value()
|
129
|
+
})
|
130
|
+
.on('error', /* istanbul ignore next */ (err) => reject(err))
|
131
|
+
.on('exit', (code) => code === 0
|
132
|
+
? resolve()
|
133
|
+
: reject(new DetoxRuntimeError(`Command failed with exit code = ${code}:\n${fullCommandWithHint}`)
|
134
|
+
));
|
135
|
+
});
|
136
|
+
}
|
137
|
+
|
138
|
+
_buildSpawnArguments() {
|
139
|
+
/* istanbul ignore next */
|
140
|
+
const { _: specs = [], '--': passthrough = [], $0, ...argv } = this._argv;
|
141
|
+
const { _: $0_, ...$0argv } = parser($0);
|
142
|
+
|
143
|
+
return [
|
144
|
+
...$0_,
|
145
|
+
...unparse($0argv),
|
146
|
+
...unparse(argv),
|
147
|
+
...unparse({ _: [...passthrough, ...specs] }),
|
148
|
+
].map(String);
|
149
|
+
}
|
150
|
+
|
151
|
+
_logRelaunchError() {
|
152
|
+
const list = this._argv._.map((file, index) => {
|
153
|
+
return ` ${index + 1}. ${file}`;
|
154
|
+
}).join('\n');
|
155
|
+
|
156
|
+
log.error(
|
157
|
+
`There were failing tests in the following files:\n${list}\n\n` +
|
158
|
+
'Detox CLI is going to restart the test runner with those files...\n'
|
159
|
+
);
|
160
|
+
}
|
161
|
+
}
|
162
|
+
|
163
|
+
module.exports = TestRunnerCommand;
|
@@ -10,27 +10,17 @@ module.exports = {
|
|
10
10
|
describe:
|
11
11
|
'Select a device configuration from your defined configurations, if not supplied, and there\'s only one configuration, detox will default to it',
|
12
12
|
},
|
13
|
-
o: {
|
14
|
-
alias: 'runner-config',
|
15
|
-
group: 'Configuration:',
|
16
|
-
describe: 'Test runner config file, defaults to e2e/mocha.opts for mocha and e2e/config.json for jest',
|
17
|
-
},
|
18
13
|
l: {
|
19
14
|
alias: 'loglevel',
|
20
15
|
group: 'Debugging:',
|
21
|
-
choices: ['fatal', 'error', 'warn', 'info', 'verbose', 'trace'],
|
16
|
+
choices: ['fatal', 'error', 'warn', 'info', 'verbose', 'debug', 'trace'],
|
22
17
|
describe: 'Log level',
|
23
18
|
},
|
24
|
-
'no-color': {
|
25
|
-
describe: 'Disable colors in log output',
|
26
|
-
boolean: true,
|
27
|
-
},
|
28
19
|
R: {
|
29
20
|
alias: 'retries',
|
30
21
|
group: 'Execution:',
|
31
|
-
describe: '
|
22
|
+
describe: 'Re-spawn the test runner for individual failing suite files until they pass, or <N> times at least.',
|
32
23
|
number: true,
|
33
|
-
default: 0,
|
34
24
|
},
|
35
25
|
r: {
|
36
26
|
alias: 'reuse',
|
@@ -48,10 +38,6 @@ module.exports = {
|
|
48
38
|
alias: 'debug-synchronization',
|
49
39
|
group: 'Debugging:',
|
50
40
|
coerce(value) {
|
51
|
-
if (value == null) {
|
52
|
-
return undefined;
|
53
|
-
}
|
54
|
-
|
55
41
|
if (value === false || value === 'false') {
|
56
42
|
return 0;
|
57
43
|
}
|
@@ -96,33 +82,23 @@ module.exports = {
|
|
96
82
|
choices: ['enabled', 'disabled'],
|
97
83
|
describe: '[iOS Only] Capture *.uihierarchy snapshots on view action errors and device.captureViewHierarchy() calls.',
|
98
84
|
},
|
99
|
-
'record-timeline': {
|
100
|
-
group: 'Debugging:',
|
101
|
-
choices: ['all', 'none'],
|
102
|
-
describe: '[Jest Only] Record tests and events timeline, for visual display on the chrome://tracing tool.',
|
103
|
-
},
|
104
|
-
w: {
|
105
|
-
alias: 'workers',
|
106
|
-
group: 'Execution:',
|
107
|
-
describe: 'Specifies the number of workers the test runner should spawn. Requires a test runner with parallel execution support (e.g. Jest)',
|
108
|
-
number: true,
|
109
|
-
},
|
110
85
|
'jest-report-specs': {
|
111
86
|
group: 'Execution:',
|
112
|
-
describe: '
|
87
|
+
describe: 'Whether to output logs per each running spec, in real-time. By default, disabled with multiple workers.',
|
113
88
|
boolean: true,
|
114
89
|
},
|
115
90
|
H: {
|
116
91
|
alias: 'headless',
|
117
92
|
group: 'Execution:',
|
118
|
-
describe: '
|
93
|
+
describe: 'Launch device in headless mode. Useful when running on CI.',
|
119
94
|
boolean: true,
|
120
95
|
},
|
121
96
|
gpu: {
|
122
97
|
group: 'Execution:',
|
123
|
-
|
98
|
+
choices: ['auto', 'host', 'swiftshader_indirect', 'angle_indirect', 'guest', 'off'],
|
99
|
+
describe: '[Android Only] Launch emulator with the specific -gpu [gpu mode] parameter.',
|
124
100
|
},
|
125
|
-
keepLockFile:{
|
101
|
+
keepLockFile: {
|
126
102
|
group: 'Configuration:',
|
127
103
|
describe:'Keep the device lock file when running Detox tests',
|
128
104
|
boolean: true,
|
@@ -133,7 +109,6 @@ module.exports = {
|
|
133
109
|
describe: 'Override the device name specified in a configuration. Useful for running a single build configuration on multiple devices.',
|
134
110
|
},
|
135
111
|
'device-boot-args': {
|
136
|
-
alias: 'device-launch-args',
|
137
112
|
group: 'Execution:',
|
138
113
|
describe: 'Custom arguments to pass (through) onto the device (emulator/simulator) binary when booted.',
|
139
114
|
},
|
@@ -143,18 +118,17 @@ module.exports = {
|
|
143
118
|
},
|
144
119
|
'use-custom-logger': {
|
145
120
|
boolean: true,
|
146
|
-
default: true,
|
147
121
|
group: 'Execution:',
|
148
|
-
describe: `Use Detox' custom console-logging implementation, for logging Detox (non-device) logs. Disabling will fallback to node.js / test
|
122
|
+
describe: `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).`,
|
149
123
|
},
|
150
124
|
'force-adb-install': {
|
151
125
|
boolean: true,
|
152
126
|
group: 'Execution:',
|
153
|
-
describe: `Due to problems with the "adb install" command on Android, Detox resorts to a different scheme for install APK's. Setting true will disable that and force usage of "adb install", instead.`,
|
127
|
+
describe: `[Android Only] Due to problems with the "adb install" command on Android, Detox resorts to a different scheme for install APK's. Setting true will disable that and force usage of "adb install", instead.`,
|
154
128
|
},
|
155
129
|
'inspect-brk': {
|
156
130
|
group: 'Debugging:',
|
157
|
-
describe: 'Allows debugging of the underlying test runner',
|
131
|
+
describe: '[Jest Only] Allows debugging of the underlying test runner',
|
158
132
|
boolean: true,
|
159
133
|
}
|
160
134
|
};
|
@@ -0,0 +1,66 @@
|
|
1
|
+
const _ = require('lodash');
|
2
|
+
|
3
|
+
const { log } = require('../../internals');
|
4
|
+
const { getJestBooleanArgs } = require('../utils/jestInternals');
|
5
|
+
const { simpleUnquote, extractKnownKeys, disengageBooleanArgs } = require('../utils/yargsUtils');
|
6
|
+
|
7
|
+
const testCommandArgs = require('./builder');
|
8
|
+
const { DETOX_ARGV_OVERRIDE_NOTICE } = require('./warnings');
|
9
|
+
|
10
|
+
function applyEnvironmentVariableAddendum(argv, yargs) {
|
11
|
+
if (process.env.DETOX_ARGV_OVERRIDE) {
|
12
|
+
log.warn(DETOX_ARGV_OVERRIDE_NOTICE);
|
13
|
+
|
14
|
+
const { _: positional, '--': passthrough, ...named } = yargs.parse(process.env.DETOX_ARGV_OVERRIDE);
|
15
|
+
|
16
|
+
if (!_.isEmpty(positional)) {
|
17
|
+
/* istanbul ignore next */
|
18
|
+
argv._ = argv._ || [];
|
19
|
+
argv._.push(...positional.map(simpleUnquote));
|
20
|
+
}
|
21
|
+
|
22
|
+
if (!_.isEmpty(passthrough)) {
|
23
|
+
argv['--'] = argv['--'] || [];
|
24
|
+
argv['--'].push(...passthrough.map(simpleUnquote));
|
25
|
+
}
|
26
|
+
|
27
|
+
Object.assign(argv, named);
|
28
|
+
}
|
29
|
+
|
30
|
+
return argv;
|
31
|
+
}
|
32
|
+
|
33
|
+
/**
|
34
|
+
* @param {Record<string, *>} argv
|
35
|
+
* @returns {{
|
36
|
+
* detoxArgs: Record<string, *>,
|
37
|
+
* runnerArgs: Record<string, *>
|
38
|
+
* }}
|
39
|
+
*/
|
40
|
+
function splitArgv(argv) {
|
41
|
+
const aliases = extractKnownKeys(testCommandArgs);
|
42
|
+
const isDetoxArg = (_value, key) => key === '$0' || aliases.has(key);
|
43
|
+
|
44
|
+
const detoxArgs = _.pickBy(argv, isDetoxArg);
|
45
|
+
const runnerArgv = _.omitBy(argv, isDetoxArg);
|
46
|
+
runnerArgv._ = runnerArgv._.slice(1); // omit 'test' string, as in 'detox test'
|
47
|
+
if (typeof detoxArgs['debug-synchronization'] === 'string') {
|
48
|
+
const erroneousPassthrough = detoxArgs['debug-synchronization'];
|
49
|
+
detoxArgs['debug-synchronization'] = 3000;
|
50
|
+
runnerArgv._.unshift(erroneousPassthrough);
|
51
|
+
}
|
52
|
+
|
53
|
+
const runnerArgs = disengageBooleanArgs(runnerArgv, getJestBooleanArgs());
|
54
|
+
return { detoxArgs, runnerArgs };
|
55
|
+
}
|
56
|
+
|
57
|
+
// noinspection JSUnusedGlobalSymbols
|
58
|
+
module.exports = {
|
59
|
+
applyEnvironmentVariableAddendum,
|
60
|
+
splitArgv,
|
61
|
+
};
|
62
|
+
|
63
|
+
module.exports.default = [
|
64
|
+
applyEnvironmentVariableAddendum,
|
65
|
+
splitArgv,
|
66
|
+
];
|
@@ -1,14 +1,3 @@
|
|
1
|
-
const { DEVICE_LAUNCH_ARGS_DEPRECATION } = require('../../src/configuration/utils/warnings');
|
2
|
-
const log = require('../../src/utils/logger').child({ __filename });
|
3
|
-
|
4
|
-
function coerceDeprecation(option) {
|
5
|
-
return function coerceDeprecationFn(value) {
|
6
|
-
log.warn(`Beware: ${option} will be removed in the next version of Detox.`);
|
7
|
-
|
8
|
-
return value;
|
9
|
-
};
|
10
|
-
}
|
11
|
-
|
12
1
|
const DETOX_ARGV_OVERRIDE_NOTICE = `
|
13
2
|
_____ _____ ___________
|
14
3
|
/ ___|_ _| _ | ___ \\ $DETOX_ARGV_OVERRIDE is detected
|
@@ -30,7 +19,5 @@ const DETOX_ARGV_OVERRIDE_NOTICE = `
|
|
30
19
|
`;
|
31
20
|
|
32
21
|
module.exports = {
|
33
|
-
coerceDeprecation,
|
34
22
|
DETOX_ARGV_OVERRIDE_NOTICE,
|
35
|
-
DEVICE_LAUNCH_ARGS_DEPRECATION,
|
36
23
|
};
|
@@ -2,10 +2,13 @@
|
|
2
2
|
const Module = require('module');
|
3
3
|
const path = require('path');
|
4
4
|
|
5
|
+
const _ = require('lodash');
|
5
6
|
const resolveFrom = require('resolve-from');
|
6
7
|
const semver = require('semver');
|
7
8
|
|
8
|
-
const DetoxRuntimeError = require('../../src/errors
|
9
|
+
const { DetoxRuntimeError } = require('../../src/errors');
|
10
|
+
|
11
|
+
const { extractKnownKeys } = require('./yargsUtils');
|
9
12
|
|
10
13
|
const getNodeModulePaths = (dir) => Module._nodeModulePaths(dir);
|
11
14
|
|
@@ -68,7 +71,15 @@ async function readJestConfig(argv) {
|
|
68
71
|
return readConfig(argv, process.cwd(), false);
|
69
72
|
}
|
70
73
|
|
74
|
+
function getJestBooleanArgs() {
|
75
|
+
return _(resolveJestCliArgs())
|
76
|
+
.thru(args => args.options)
|
77
|
+
.pickBy(({ type }) => type === 'boolean')
|
78
|
+
.thru(extractKnownKeys)
|
79
|
+
.value();
|
80
|
+
}
|
81
|
+
|
71
82
|
module.exports = {
|
72
|
-
|
83
|
+
getJestBooleanArgs,
|
73
84
|
readJestConfig,
|
74
85
|
};
|
@@ -0,0 +1,67 @@
|
|
1
|
+
/**
|
2
|
+
* @param {Record<string, Record<string, *>>} yargsBuilder
|
3
|
+
* @returns {Set<string>}
|
4
|
+
*/
|
5
|
+
function extractKnownKeys(yargsBuilder) {
|
6
|
+
return Object.entries(yargsBuilder).reduce(
|
7
|
+
(set, [key, option]) => {
|
8
|
+
if (option.alias) {
|
9
|
+
if (Array.isArray(option.alias)) {
|
10
|
+
for (const value of option.alias) {
|
11
|
+
set.add(value);
|
12
|
+
}
|
13
|
+
} else {
|
14
|
+
set.add(option.alias);
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
return set.add(key);
|
19
|
+
},
|
20
|
+
new Set()
|
21
|
+
);
|
22
|
+
}
|
23
|
+
|
24
|
+
/**
|
25
|
+
* @param {Record<string, *>} argv
|
26
|
+
* @param {Set<string>} booleanKeys
|
27
|
+
* @returns {Record<string, *>}
|
28
|
+
*/
|
29
|
+
function disengageBooleanArgs(argv, booleanKeys) {
|
30
|
+
const result = {};
|
31
|
+
const passthrough = [];
|
32
|
+
|
33
|
+
for (const entry of Object.entries(argv)) {
|
34
|
+
const [key, value] = entry;
|
35
|
+
if (key === '_' || key === '--') {
|
36
|
+
continue;
|
37
|
+
}
|
38
|
+
|
39
|
+
const positiveKey = key.startsWith('no-') ? key.slice(3) : key;
|
40
|
+
if (booleanKeys.has(positiveKey) && typeof value !== 'boolean') {
|
41
|
+
result[positiveKey] = key === positiveKey;
|
42
|
+
passthrough.push(value);
|
43
|
+
} else {
|
44
|
+
result[key] = value;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
return {
|
49
|
+
...result,
|
50
|
+
'_': passthrough.concat(argv._),
|
51
|
+
'--': argv['--'] || [],
|
52
|
+
};
|
53
|
+
}
|
54
|
+
|
55
|
+
function simpleUnquote(arg) {
|
56
|
+
if ((arg[0] === '"' || arg[0] === "'") && arg[0] === arg[arg.length - 1]) {
|
57
|
+
return arg.slice(1, -1);
|
58
|
+
}
|
59
|
+
|
60
|
+
return arg;
|
61
|
+
}
|
62
|
+
|
63
|
+
module.exports = {
|
64
|
+
disengageBooleanArgs,
|
65
|
+
extractKnownKeys,
|
66
|
+
simpleUnquote,
|
67
|
+
};
|
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": "
|
4
|
+
"version": "20.0.0",
|
5
5
|
"bin": {
|
6
6
|
"detox": "local-cli/cli.js"
|
7
7
|
},
|
@@ -14,7 +14,7 @@
|
|
14
14
|
"url": "https://github.com/wix/Detox/issues"
|
15
15
|
},
|
16
16
|
"homepage": "https://github.com/wix/Detox#readme",
|
17
|
-
"main": "./
|
17
|
+
"main": "./index.js",
|
18
18
|
"types": "./index.d.ts",
|
19
19
|
"author": "Tal Kol <talkol@gmail.com>",
|
20
20
|
"license": "MIT",
|
@@ -32,9 +32,12 @@
|
|
32
32
|
"postinstall": "node scripts/postinstall.js"
|
33
33
|
},
|
34
34
|
"devDependencies": {
|
35
|
+
"@types/bunyan": "^1.8.8",
|
35
36
|
"@types/child-process-promise": "^2.2.1",
|
36
|
-
"@types/
|
37
|
-
"@types/
|
37
|
+
"@types/fs-extra": "^9.0.13",
|
38
|
+
"@types/jest": "^28.1.8",
|
39
|
+
"@types/node": "^14.18.33",
|
40
|
+
"@types/node-ipc": "^9.2.0",
|
38
41
|
"@types/ws": "^7.4.0",
|
39
42
|
"@typescript-eslint/eslint-plugin": "^5.4.0",
|
40
43
|
"@typescript-eslint/parser": "^5.4.0",
|
@@ -43,8 +46,7 @@
|
|
43
46
|
"eslint-plugin-no-only-tests": "^2.6.0",
|
44
47
|
"eslint-plugin-node": "^11.1.0",
|
45
48
|
"eslint-plugin-unicorn": "^39.0.0",
|
46
|
-
"jest": "^28.
|
47
|
-
"mocha": ">=6.0.0",
|
49
|
+
"jest": "^28.1.3",
|
48
50
|
"mockdate": "^2.0.1",
|
49
51
|
"prettier": "1.7.0",
|
50
52
|
"react-native": "0.69.7",
|
@@ -55,15 +57,22 @@
|
|
55
57
|
"dependencies": {
|
56
58
|
"ajv": "^8.6.3",
|
57
59
|
"bunyan": "^1.8.12",
|
58
|
-
"bunyan-debug-stream": "^
|
60
|
+
"bunyan-debug-stream": "^3.1.0",
|
61
|
+
"caf": "^15.0.1",
|
59
62
|
"chalk": "^2.4.2",
|
60
63
|
"child-process-promise": "^2.2.0",
|
64
|
+
"duplexify": "^4.1.2",
|
61
65
|
"find-up": "^4.1.0",
|
62
66
|
"fs-extra": "^4.0.2",
|
63
67
|
"funpermaproxy": "^1.0.1",
|
68
|
+
"glob": "^8.0.3",
|
64
69
|
"ini": "^1.3.4",
|
70
|
+
"json-cycle": "^1.3.0",
|
65
71
|
"lodash": "^4.17.5",
|
66
72
|
"minimist": "^1.2.0",
|
73
|
+
"multi-sort-stream": "^1.0.3",
|
74
|
+
"multipipe": "^4.0.0",
|
75
|
+
"node-ipc": "^9.2.1",
|
67
76
|
"proper-lockfile": "^3.0.2",
|
68
77
|
"resolve-from": "^5.0.0",
|
69
78
|
"sanitize-filename": "^1.6.1",
|
@@ -71,29 +80,28 @@
|
|
71
80
|
"serialize-error": "^8.0.1",
|
72
81
|
"shell-quote": "^1.7.2",
|
73
82
|
"signal-exit": "^3.0.3",
|
83
|
+
"stream-json": "^1.7.4",
|
84
|
+
"strip-ansi": "^6.0.1",
|
74
85
|
"tail": "^2.0.0",
|
75
86
|
"telnet-client": "1.2.8",
|
76
87
|
"tempfile": "^2.0.0",
|
88
|
+
"trace-event-lib": "^1.3.1",
|
77
89
|
"which": "^1.3.1",
|
78
90
|
"ws": "^7.0.0",
|
79
91
|
"yargs": "^16.0.3",
|
80
|
-
"yargs-parser": "^20.2.
|
92
|
+
"yargs-parser": "^20.2.9",
|
81
93
|
"yargs-unparser": "^2.0.0"
|
82
94
|
},
|
83
95
|
"peerDependencies": {
|
84
|
-
"jest": "
|
85
|
-
"mocha": ">=6.0.0"
|
96
|
+
"jest": "29.x.x || 28.x.x || ^27.2.5"
|
86
97
|
},
|
87
98
|
"peerDependenciesMeta": {
|
88
99
|
"jest": {
|
89
100
|
"optional": true
|
90
|
-
},
|
91
|
-
"mocha": {
|
92
|
-
"optional": true
|
93
101
|
}
|
94
102
|
},
|
95
103
|
"engines": {
|
96
|
-
"node": ">=
|
104
|
+
"node": ">=14.5.0"
|
97
105
|
},
|
98
106
|
"jest": {
|
99
107
|
"setupFiles": [
|
@@ -103,8 +111,9 @@
|
|
103
111
|
"testRunner": "jest-circus/runner",
|
104
112
|
"roots": [
|
105
113
|
"node_modules",
|
114
|
+
"local-cli",
|
106
115
|
"src",
|
107
|
-
"
|
116
|
+
"runners"
|
108
117
|
],
|
109
118
|
"testPathIgnorePatterns": [
|
110
119
|
"/node_modules/",
|
@@ -124,7 +133,6 @@
|
|
124
133
|
"src/artifacts/screenshot",
|
125
134
|
"src/artifacts/video",
|
126
135
|
"src/devices/allocation/drivers/AllocationDriverBase.js",
|
127
|
-
"src/devices/allocation/drivers/NoneAllocDriver.js",
|
128
136
|
"src/devices/allocation/drivers/android/emulator/launchEmulatorProcess.js",
|
129
137
|
"src/devices/allocation/drivers/android/emulator/patchAvdSkinConfig.js",
|
130
138
|
"src/devices/allocation/drivers/ios",
|
@@ -145,14 +153,19 @@
|
|
145
153
|
"src/validation/EnvironmentValidatorBase.js",
|
146
154
|
"src/validation/factories",
|
147
155
|
"src/validation/ios/IosSimulatorEnvValidator",
|
148
|
-
"src/utils/MissingDetox.js",
|
149
156
|
"src/utils/appdatapath.js",
|
150
157
|
"src/utils/debug.js",
|
151
158
|
"src/utils/environment.js",
|
152
159
|
"src/utils/logger.js",
|
153
160
|
"src/utils/pipeCommands.js",
|
154
161
|
"src/utils/pressAnyKey.js",
|
155
|
-
"src/utils/shellUtils.js"
|
162
|
+
"src/utils/shellUtils.js",
|
163
|
+
"runners/jest/reporters",
|
164
|
+
"runners/jest/testEnvironment",
|
165
|
+
"src/DetoxWorker.js",
|
166
|
+
"src/logger/utils/streamUtils.js",
|
167
|
+
"src/ipc",
|
168
|
+
"src/realms"
|
156
169
|
],
|
157
170
|
"resetMocks": true,
|
158
171
|
"resetModules": true,
|
@@ -177,5 +190,5 @@
|
|
177
190
|
}
|
178
191
|
}
|
179
192
|
},
|
180
|
-
"gitHead": "
|
193
|
+
"gitHead": "8c533cd0bbbd514071a31355516292a2cf3c89ce"
|
181
194
|
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
const chalk = require('chalk');
|
2
|
+
|
3
|
+
// @ts-ignore
|
4
|
+
const bold = chalk.bold;
|
5
|
+
|
6
|
+
function getMaxWidth(text) {
|
7
|
+
const lines = text.split('\n');
|
8
|
+
return lines.reduce((acc, line) => Math.max(acc, line.length), 0);
|
9
|
+
}
|
10
|
+
|
11
|
+
function centerText(text, maxWidth = getMaxWidth(text)) {
|
12
|
+
return text
|
13
|
+
.split('\n')
|
14
|
+
.map(line => {
|
15
|
+
const padStart = Math.max(0, Math.floor((maxWidth - line.length) / 2));
|
16
|
+
const padEnd = Math.max(0, maxWidth - line.length - padStart);
|
17
|
+
return ' '.repeat(padStart) + line + ' '.repeat(padEnd);
|
18
|
+
})
|
19
|
+
.join('\n');
|
20
|
+
}
|
21
|
+
|
22
|
+
const header = `\
|
23
|
+
========================= THE NEW JOURNEY BEGINS =============================`;
|
24
|
+
|
25
|
+
console.error(centerText(`\
|
26
|
+
|
27
|
+
${bold(header)}
|
28
|
+
|
29
|
+
https://wix.github.io/Detox/docs/guide/migration
|
30
|
+
|
31
|
+
Sorry to say that Detox 20 comes without old adapters for Jest.
|
32
|
+
You have to rearrange your init code before you can continue your journey.
|
33
|
+
|
34
|
+
Navigate to the link and follow the migration guide steps.
|
35
|
+
|
36
|
+
Sincerely yours,
|
37
|
+
Detox team.
|
38
|
+
|
39
|
+
${bold(header)}
|
40
|
+
|
41
|
+
`, header.length));
|
42
|
+
|
43
|
+
const error = new Error('\nPlease follow the migration guide:\nhttps://wix.github.io/Detox/docs/guide/migration\n\n');
|
44
|
+
error.stack = '';
|
45
|
+
throw error;
|