detox 20.6.0 → 20.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. package/Detox-android/com/wix/detox/{20.6.0/detox-20.6.0-javadoc.jar → 20.7.0/detox-20.7.0-javadoc.jar} +0 -0
  2. package/Detox-android/com/wix/detox/20.7.0/detox-20.7.0-javadoc.jar.md5 +1 -0
  3. package/Detox-android/com/wix/detox/20.7.0/detox-20.7.0-javadoc.jar.sha1 +1 -0
  4. package/Detox-android/com/wix/detox/20.7.0/detox-20.7.0-javadoc.jar.sha256 +1 -0
  5. package/Detox-android/com/wix/detox/20.7.0/detox-20.7.0-javadoc.jar.sha512 +1 -0
  6. package/Detox-android/com/wix/detox/{20.6.0/detox-20.6.0-sources.jar → 20.7.0/detox-20.7.0-sources.jar} +0 -0
  7. package/Detox-android/com/wix/detox/20.7.0/detox-20.7.0-sources.jar.md5 +1 -0
  8. package/Detox-android/com/wix/detox/20.7.0/detox-20.7.0-sources.jar.sha1 +1 -0
  9. package/Detox-android/com/wix/detox/20.7.0/detox-20.7.0-sources.jar.sha256 +1 -0
  10. package/Detox-android/com/wix/detox/20.7.0/detox-20.7.0-sources.jar.sha512 +1 -0
  11. package/Detox-android/com/wix/detox/{20.6.0/detox-20.6.0.pom → 20.7.0/detox-20.7.0.pom} +1 -1
  12. package/Detox-android/com/wix/detox/20.7.0/detox-20.7.0.pom.md5 +1 -0
  13. package/Detox-android/com/wix/detox/20.7.0/detox-20.7.0.pom.sha1 +1 -0
  14. package/Detox-android/com/wix/detox/20.7.0/detox-20.7.0.pom.sha256 +1 -0
  15. package/Detox-android/com/wix/detox/20.7.0/detox-20.7.0.pom.sha512 +1 -0
  16. package/Detox-android/com/wix/detox/maven-metadata.xml +4 -4
  17. package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +1 -1
  18. package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +1 -1
  19. package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +1 -1
  20. package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +1 -1
  21. package/Detox-ios-src.tbz +0 -0
  22. package/Detox-ios.tbz +0 -0
  23. package/package.json +3 -3
  24. package/runners/jest/testEnvironment/listeners/SpecReporter.js +1 -1
  25. package/runners/jest/testEnvironment/listeners/WorkerAssignReporter.js +1 -1
  26. package/src/DetoxWorker.js +6 -1
  27. package/src/devices/allocation/DeviceAllocator.js +13 -1
  28. package/src/devices/allocation/drivers/AllocationDriverBase.js +6 -0
  29. package/src/devices/allocation/drivers/android/attached/AttachedAndroidAllocDriver.js +10 -1
  30. package/src/devices/allocation/drivers/android/emulator/EmulatorAllocDriver.js +27 -29
  31. package/src/devices/allocation/drivers/android/genycloud/GenyAllocDriver.js +27 -19
  32. package/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js +12 -7
  33. package/src/logger/DetoxLogger.js +5 -5
  34. package/src/utils/Timer.js +6 -0
  35. package/Detox-android/com/wix/detox/20.6.0/detox-20.6.0-javadoc.jar.md5 +0 -1
  36. package/Detox-android/com/wix/detox/20.6.0/detox-20.6.0-javadoc.jar.sha1 +0 -1
  37. package/Detox-android/com/wix/detox/20.6.0/detox-20.6.0-javadoc.jar.sha256 +0 -1
  38. package/Detox-android/com/wix/detox/20.6.0/detox-20.6.0-javadoc.jar.sha512 +0 -1
  39. package/Detox-android/com/wix/detox/20.6.0/detox-20.6.0-sources.jar.md5 +0 -1
  40. package/Detox-android/com/wix/detox/20.6.0/detox-20.6.0-sources.jar.sha1 +0 -1
  41. package/Detox-android/com/wix/detox/20.6.0/detox-20.6.0-sources.jar.sha256 +0 -1
  42. package/Detox-android/com/wix/detox/20.6.0/detox-20.6.0-sources.jar.sha512 +0 -1
  43. package/Detox-android/com/wix/detox/20.6.0/detox-20.6.0.pom.md5 +0 -1
  44. package/Detox-android/com/wix/detox/20.6.0/detox-20.6.0.pom.sha1 +0 -1
  45. package/Detox-android/com/wix/detox/20.6.0/detox-20.6.0.pom.sha256 +0 -1
  46. package/Detox-android/com/wix/detox/20.6.0/detox-20.6.0.pom.sha512 +0 -1
  47. /package/Detox-android/com/wix/detox/{20.6.0/detox-20.6.0.aar → 20.7.0/detox-20.7.0.aar} +0 -0
  48. /package/Detox-android/com/wix/detox/{20.6.0/detox-20.6.0.aar.md5 → 20.7.0/detox-20.7.0.aar.md5} +0 -0
  49. /package/Detox-android/com/wix/detox/{20.6.0/detox-20.6.0.aar.sha1 → 20.7.0/detox-20.7.0.aar.sha1} +0 -0
  50. /package/Detox-android/com/wix/detox/{20.6.0/detox-20.6.0.aar.sha256 → 20.7.0/detox-20.7.0.aar.sha256} +0 -0
  51. /package/Detox-android/com/wix/detox/{20.6.0/detox-20.6.0.aar.sha512 → 20.7.0/detox-20.7.0.aar.sha512} +0 -0
@@ -0,0 +1 @@
1
+ f81d27f94760c9593fb2465e3e85b8c6
@@ -0,0 +1 @@
1
+ d54cd363e0644bcd2c5e80d38aea9951ed5a5875
@@ -0,0 +1 @@
1
+ 8a069a0d9b81a4da63c1669dda4132884116d1fd59535b9f2042a2de1d2192fb
@@ -0,0 +1 @@
1
+ b5b1b636a1a188f0fbab9fdcea0778bc7843c32b11f3d7f4723de639d44cf2954e94f4724e86a04bc25e93701aea54210786f36a97804c514b6c37c54cc7c694
@@ -0,0 +1 @@
1
+ 1d700c36ee5a9f920dc9b11b8aaba734
@@ -0,0 +1 @@
1
+ cde0211d368551547ba536f6d48f82701f0cb54d
@@ -0,0 +1 @@
1
+ 098e816f3ba9c3a19cfdaa7a3a42d6282d2fce21f311388503f1cac1677af4a7
@@ -0,0 +1 @@
1
+ 7a5d1df7fcb8894f17f4e1ecd502c977369bcfb83f1f86c4df4d53f05517f710a49fe0a1bb417ee621027f8effc8344d6d0ceb5d8b5f46f9caa739f8cbfb2d3f
@@ -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.6.0</version>
6
+ <version>20.7.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
+ 5613ab9eb27dcbb4d5e7779c2137b156
@@ -0,0 +1 @@
1
+ 622796a4e65be99d5fc209fb47cf2f8dd11f0c6b
@@ -0,0 +1 @@
1
+ 6a3a55e38f2a0f92863399c78071ba55c8ccfdd8fae13e668f13a52f1d8a20a1
@@ -0,0 +1 @@
1
+ 19988e0ea2b71c2283a48de7a4a35ac043ddba4629f9db146fe320392f8961d51e1ea570dde8c282e7a191fec69683321f6db223a7bb663e7b2c950deff3dc7f
@@ -3,11 +3,11 @@
3
3
  <groupId>com.wix</groupId>
4
4
  <artifactId>detox</artifactId>
5
5
  <versioning>
6
- <latest>20.6.0</latest>
7
- <release>20.6.0</release>
6
+ <latest>20.7.0</latest>
7
+ <release>20.7.0</release>
8
8
  <versions>
9
- <version>20.6.0</version>
9
+ <version>20.7.0</version>
10
10
  </versions>
11
- <lastUpdated>20230322171518</lastUpdated>
11
+ <lastUpdated>20230411123945</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- f72e8f5e279054eb2e8e8faab020aaab
1
+ 9e29832400056f30d8baa679804465e1
@@ -1 +1 @@
1
- 4e3513e973cd69a3ce1b30d0756ba26660ae1ba6
1
+ 95431bbe6516e3f812d80a6fa2a874591f4db65b
@@ -1 +1 @@
1
- 319540a82e8d028d9fe417155b17c95ae4d62f0cf9f18a751a1827a27acf1802
1
+ 8ced38de926b73ba9b74dd7ffe47c7775885527060e97544bf37e0d8edf847f9
@@ -1 +1 @@
1
- 92f9a95efb7117c43c5df7765e56d81d8ef34b2413ef04e6133d7a3d51ccb88bec0aa80bba83d302ebe4dee638270ec57e03b0a3fc972e8552fd94365065fd3a
1
+ 25c96c6db588afca21ce6a630e25c8cb619f8fa7967ad641fd0f6811d243e736ac3986b4828773d9152cd7f789fca65308fd6f8094f52822d6edff5674719afb
package/Detox-ios-src.tbz CHANGED
Binary file
package/Detox-ios.tbz CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "detox",
3
3
  "description": "E2E tests and automation for mobile",
4
- "version": "20.6.0",
4
+ "version": "20.7.0",
5
5
  "bin": {
6
6
  "detox": "local-cli/cli.js"
7
7
  },
@@ -61,7 +61,7 @@
61
61
  "bunyan": "^1.8.12",
62
62
  "bunyan-debug-stream": "^3.1.0",
63
63
  "caf": "^15.0.1",
64
- "chalk": "^2.4.2",
64
+ "chalk": "^4.0.0",
65
65
  "child-process-promise": "^2.2.0",
66
66
  "execa": "^5.1.1",
67
67
  "find-up": "^4.1.0",
@@ -200,5 +200,5 @@
200
200
  }
201
201
  }
202
202
  },
203
- "gitHead": "03e23e76b54f1e7de70495e0ec8a8db45872b0e6"
203
+ "gitHead": "4d316b08ec884b8dbc6bb8a19eeb134e2e4dc4d2"
204
204
  }
@@ -1,4 +1,4 @@
1
- const chalk = require('chalk').default;
1
+ const chalk = require('chalk');
2
2
  const noop = require('lodash/noop');
3
3
 
4
4
  const { config, log, session } = require('../../../../internals');
@@ -1,6 +1,6 @@
1
1
  const path = require('path');
2
2
 
3
- const chalk = require('chalk').default;
3
+ const chalk = require('chalk');
4
4
  const _ = require('lodash');
5
5
 
6
6
  const { device } = require('../../../..');
@@ -138,6 +138,8 @@ class DetoxWorker {
138
138
  this._deviceAllocator = deviceAllocatorFactory.createDeviceAllocator(commonDeps);
139
139
  this._deviceCookie = yield this._deviceAllocator.allocate(this._deviceConfig);
140
140
 
141
+ yield this._deviceAllocator.postAllocate(this._deviceCookie);
142
+
141
143
  this.device = runtimeDeviceFactory.createRuntimeDevice(
142
144
  this._deviceCookie,
143
145
  commonDeps,
@@ -200,9 +202,12 @@ class DetoxWorker {
200
202
  }
201
203
 
202
204
  if (this.device) {
203
- const shutdown = this._behaviorConfig ? this._behaviorConfig.cleanup.shutdownDevice : false;
204
205
  // @ts-ignore
205
206
  await this.device._cleanup();
207
+ }
208
+
209
+ if (this._deviceCookie) {
210
+ const shutdown = this._behaviorConfig ? this._behaviorConfig.cleanup.shutdownDevice : false;
206
211
  await this._deviceAllocator.free(this._deviceCookie, { shutdown });
207
212
  }
208
213
 
@@ -8,7 +8,7 @@ class DeviceAllocator {
8
8
  */
9
9
  constructor(allocationDriver) {
10
10
  this._driver = allocationDriver;
11
- traceMethods(log, this, ['allocate', 'free']);
11
+ traceMethods(log, this, ['allocate', 'postAllocate', 'free']);
12
12
  }
13
13
 
14
14
  /**
@@ -19,6 +19,18 @@ class DeviceAllocator {
19
19
  return this._driver.allocate(deviceConfig);
20
20
  }
21
21
 
22
+ /**
23
+ * @param {DeviceCookie} deviceCookie
24
+ * @return {Promise<unknown>}
25
+ */
26
+ postAllocate(deviceCookie) {
27
+ if (typeof this._driver.postAllocate !== 'function') {
28
+ return Promise.resolve();
29
+ }
30
+
31
+ return this._driver.postAllocate(deviceCookie);
32
+ }
33
+
22
34
  /**
23
35
  * @param cookie { DeviceCookie }
24
36
  * @param options { DeallocOptions }
@@ -13,6 +13,12 @@ class AllocationDriverBase {
13
13
  */
14
14
  async allocate(deviceConfig) {}
15
15
 
16
+ /**
17
+ * @param {DeviceCookie} deviceCookie
18
+ * @return {Promise<void>}
19
+ */
20
+ async postAllocate(deviceCookie) {}
21
+
16
22
  /**
17
23
  * @param cookie { DeviceCookie }
18
24
  * @param options { DeallocOptions }
@@ -25,11 +25,20 @@ class AttachedAndroidAllocDriver extends AllocationDriverBase {
25
25
  const adbNamePattern = deviceConfig.device.adbName;
26
26
  const adbName = await this._deviceRegistry.allocateDevice(() => this._freeDeviceFinder.findFreeDevice(adbNamePattern));
27
27
 
28
+ return new AttachedAndroidDeviceCookie(adbName);
29
+ }
30
+
31
+ /**
32
+ * @param {AttachedAndroidDeviceCookie} deviceCookie
33
+ * @returns {Promise<void>}
34
+ */
35
+ async postAllocate(deviceCookie) {
36
+ const { adbName } = deviceCookie;
37
+
28
38
  // TODO Also disable native animations?
29
39
  await this._adb.apiLevel(adbName);
30
40
  await this._adb.unlockScreen(adbName);
31
41
  await this._attachedAndroidLauncher.notifyLaunchCompleted(adbName);
32
- return new AttachedAndroidDeviceCookie(adbName);
33
42
  }
34
43
 
35
44
  /**
@@ -1,8 +1,6 @@
1
1
  // @ts-nocheck
2
2
  const _ = require('lodash');
3
3
 
4
- const log = require('../../../../../utils/logger').child({ cat: 'device' });
5
- const traceMethods = require('../../../../../utils/traceMethods');
6
4
  const AndroidEmulatorCookie = require('../../../../cookies/AndroidEmulatorCookie');
7
5
  const AllocationDriverBase = require('../../AllocationDriverBase');
8
6
 
@@ -23,8 +21,7 @@ class EmulatorAllocDriver extends AllocationDriverBase {
23
21
  this._emulatorVersionResolver = emulatorVersionResolver;
24
22
  this._emulatorLauncher = emulatorLauncher;
25
23
  this._allocationHelper = allocationHelper;
26
-
27
- traceMethods(log, this, ['_launchEmulator']);
24
+ this._launchInfo = {};
28
25
  }
29
26
 
30
27
  /**
@@ -38,21 +35,37 @@ class EmulatorAllocDriver extends AllocationDriverBase {
38
35
  await this._fixAvdConfigIniSkinNameIfNeeded(avdName, deviceConfig.headless);
39
36
 
40
37
  const allocResult = await this._allocationHelper.allocateDevice(avdName);
41
- const { adbName, placeholderPort, isRunning } = allocResult;
42
- const launchOptions = {
43
- bootArgs: deviceConfig.bootArgs,
44
- gpuMode: deviceConfig.gpuMode,
45
- headless: deviceConfig.headless,
46
- readonly: deviceConfig.readonly,
47
- port: placeholderPort,
38
+ const { adbName } = allocResult;
39
+
40
+ this._launchInfo[adbName] = {
41
+ avdName,
42
+ isRunning: allocResult.isRunning,
43
+ launchOptions: {
44
+ bootArgs: deviceConfig.bootArgs,
45
+ gpuMode: deviceConfig.gpuMode,
46
+ headless: deviceConfig.headless,
47
+ readonly: deviceConfig.readonly,
48
+ port: allocResult.placeholderPort,
49
+ },
48
50
  };
49
51
 
50
- await this._launchEmulator(avdName, adbName, isRunning, launchOptions);
51
- await this._prepareEmulator(adbName);
52
-
53
52
  return new AndroidEmulatorCookie(adbName);
54
53
  }
55
54
 
55
+ /**
56
+ * @param {AndroidEmulatorCookie} deviceCookie
57
+ * @returns {Promise<void>}
58
+ */
59
+ async postAllocate(deviceCookie) {
60
+ const { adbName } = deviceCookie;
61
+ const { avdName, isRunning, launchOptions } = this._launchInfo[adbName];
62
+
63
+ await this._emulatorLauncher.launch(avdName, adbName, isRunning, launchOptions);
64
+ await this._adb.apiLevel(adbName);
65
+ await this._adb.disableAndroidAnimations(adbName);
66
+ await this._adb.unlockScreen(adbName);
67
+ }
68
+
56
69
  /**
57
70
  * @param cookie { AndroidEmulatorCookie }
58
71
  * @param options { DeallocOptions }
@@ -73,21 +86,6 @@ class EmulatorAllocDriver extends AllocationDriverBase {
73
86
  const binaryVersion = _.get(rawBinaryVersion, 'major');
74
87
  return await patchAvdSkinConfig(avdName, binaryVersion);
75
88
  }
76
-
77
- async _launchEmulator(avdName, adbName, isRunning, options) {
78
- try {
79
- await this._emulatorLauncher.launch(avdName, adbName, isRunning, options);
80
- } catch (e) {
81
- await this._allocationHelper.deallocateDevice(adbName);
82
- throw e;
83
- }
84
- }
85
-
86
- async _prepareEmulator(adbName) {
87
- await this._adb.apiLevel(adbName);
88
- await this._adb.disableAndroidAnimations(adbName);
89
- await this._adb.unlockScreen(adbName);
90
- }
91
89
  }
92
90
 
93
91
  module.exports = EmulatorAllocDriver;
@@ -1,22 +1,25 @@
1
- // @ts-nocheck
2
- const DetoxRuntimeError = require('../../../../../errors/DetoxRuntimeError');
1
+ const { DetoxRuntimeError } = require('../../../../../errors');
2
+ const Timer = require('../../../../../utils/Timer');
3
3
  const GenycloudEmulatorCookie = require('../../../../cookies/GenycloudEmulatorCookie');
4
4
  const AllocationDriverBase = require('../../AllocationDriverBase');
5
5
 
6
6
  class GenyAllocDriver extends AllocationDriverBase {
7
7
 
8
8
  /**
9
- * @param adb { ADB }
10
- * @param recipeQuerying { GenyRecipeQuerying }
11
- * @param allocationHelper { GenyInstanceAllocationHelper }
12
- * @param instanceLauncher { GenyInstanceLauncher }
9
+ * @param {object} options
10
+ * @param {import('../../../../common/drivers/android/exec/ADB')} options.adb
11
+ * @param {import('./GenyRecipeQuerying')} options.recipeQuerying
12
+ * @param {import('./GenyInstanceAllocationHelper')} options.allocationHelper
13
+ * @param {import('./GenyInstanceLauncher')} options.instanceLauncher
13
14
  */
14
15
  constructor({ adb, recipeQuerying, allocationHelper, instanceLauncher }) {
15
16
  super();
17
+
16
18
  this._adb = adb;
17
19
  this._recipeQuerying = recipeQuerying;
18
20
  this._instanceLauncher = instanceLauncher;
19
21
  this._instanceAllocationHelper = allocationHelper;
22
+ this._launchInfo = {};
20
23
  }
21
24
 
22
25
  /**
@@ -28,21 +31,26 @@ class GenyAllocDriver extends AllocationDriverBase {
28
31
  const recipe = await this._recipeQuerying.getRecipeFromQuery(deviceQuery);
29
32
  this._assertRecipe(deviceQuery, recipe);
30
33
 
31
- const allocResult = await this._instanceAllocationHelper.allocateDevice(recipe);
32
- let { instance, isNew } = allocResult;
34
+ const { instance, isNew } = await this._instanceAllocationHelper.allocateDevice(recipe);
35
+ this._launchInfo[instance.uuid] = { isNew };
36
+ return new GenycloudEmulatorCookie(instance);
37
+ }
33
38
 
34
- try {
35
- instance = await this._instanceLauncher.launch(instance, isNew);
36
- } catch (e) {
37
- await this._instanceAllocationHelper.deallocateDevice(instance.uuid);
38
- throw e;
39
- }
40
- const { adbName } = instance;
39
+ /**
40
+ * @param {GenycloudEmulatorCookie} cookie
41
+ * @returns {Promise<void>}
42
+ */
43
+ async postAllocate(cookie) {
44
+ const { instance } = cookie;
45
+ const { isNew } = this._launchInfo[instance.uuid];
46
+ const readyInstance = cookie.instance = await this._instanceLauncher.launch(instance, isNew);
41
47
 
42
- await this._adb.disableAndroidAnimations(adbName);
43
- await this._adb.setWiFiToggle(adbName, true);
44
- await this._adb.apiLevel(adbName);
45
- return new GenycloudEmulatorCookie(instance);
48
+ const { adbName } = readyInstance;
49
+ await Timer.run(20000, 'waiting for device to respond', async () => {
50
+ await this._adb.disableAndroidAnimations(adbName);
51
+ await this._adb.setWiFiToggle(adbName, true);
52
+ await this._adb.apiLevel(adbName);
53
+ });
46
54
  }
47
55
 
48
56
  /**
@@ -16,6 +16,7 @@ class SimulatorAllocDriver extends AllocationDriverBase {
16
16
  this._deviceRegistry = deviceRegistry;
17
17
  this._applesimutils = applesimutils;
18
18
  this._simulatorLauncher = simulatorLauncher;
19
+ this._launchInfo = {};
19
20
  }
20
21
 
21
22
  /**
@@ -35,16 +36,20 @@ class SimulatorAllocDriver extends AllocationDriverBase {
35
36
  throw new DetoxRuntimeError(`Failed to find device matching ${deviceComment}`);
36
37
  }
37
38
 
38
- try {
39
- await this._simulatorLauncher.launch(udid, deviceConfig.type, deviceConfig.bootArgs, deviceConfig.headless);
40
- } catch (e) {
41
- await this._deviceRegistry.disposeDevice(udid);
42
- throw e;
43
- }
44
-
39
+ this._launchInfo[udid] = { deviceConfig };
45
40
  return new IosSimulatorCookie(udid);
46
41
  }
47
42
 
43
+ /**
44
+ * @param {IosSimulatorCookie} deviceCookie
45
+ * @returns {Promise<void>}
46
+ */
47
+ async postAllocate(deviceCookie) {
48
+ const { udid } = deviceCookie;
49
+ const { deviceConfig } = this._launchInfo[udid];
50
+ await this._simulatorLauncher.launch(udid, deviceConfig.type, deviceConfig.bootArgs, deviceConfig.headless);
51
+ }
52
+
48
53
  /**
49
54
  * @param cookie { IosSimulatorCookie }
50
55
  * @param options { DeallocOptions }
@@ -310,19 +310,19 @@ class DetoxLogger {
310
310
  /** @internal */
311
311
  static defaultOptions({ level }) {
312
312
  const ph = level === 'trace' || level === 'debug'
313
- ? value => require('chalk').default.grey(value) + ' '
314
- : value => require('chalk').default.grey(value);
313
+ ? value => require('chalk').grey(value) + ' '
314
+ : value => require('chalk').grey(value);
315
315
 
316
316
  const id = level === 'trace'
317
- ? value => require('chalk').default.yellow(`@${value}`)
317
+ ? value => require('chalk').yellow(`@${value}`)
318
318
  : undefined;
319
319
 
320
320
  const cat = level === 'trace' || level === 'debug'
321
- ? (value) => require('chalk').default.yellow(`${value}`.split(',', 1)[0])
321
+ ? (value) => require('chalk').yellow(`${value}`.split(',', 1)[0])
322
322
  : undefined;
323
323
 
324
324
  const event = level === 'trace' || level === 'debug'
325
- ? (value) => require('chalk').default.grey(`:${value}`)
325
+ ? (value) => require('chalk').grey(`:${value}`)
326
326
  : undefined;
327
327
 
328
328
  const identity = x => x;
@@ -77,6 +77,12 @@ class Timer {
77
77
  Promise.resolve().then(action),
78
78
  ]);
79
79
  }
80
+
81
+ static run(timeout, description, action) {
82
+ const timer = new Timer();
83
+ timer.schedule(timeout);
84
+ return timer.run(description, action);
85
+ }
80
86
  }
81
87
 
82
88
  module.exports = Timer;
@@ -1 +0,0 @@
1
- c051f79d02bcc98757dd1ea06512a63b
@@ -1 +0,0 @@
1
- bb48d0747cb607e73a01d64f5eb758ce00e376cb
@@ -1 +0,0 @@
1
- b31397b81cdca47b2d5dc1aca7821f2691d236114064949ad8553fd81340fe02
@@ -1 +0,0 @@
1
- 6cec7c20f0d9643b98e2fa2f4740c9bb7a4b82ae3851069bb183e16ffcace8b0ceb07cf8d19316a960beb2330ea3e0a508df80cda1561242149ce3b16357d954
@@ -1 +0,0 @@
1
- 6202d8d0f83dda9ed0c9d6962259350e
@@ -1 +0,0 @@
1
- 505b10faaca41e1b5e7f27b8829cd14aff6b5626
@@ -1 +0,0 @@
1
- f4b81a4c2c1665975ac5be02698e288a311e3cd3c728ba9b05e72a1932f7482e
@@ -1 +0,0 @@
1
- e355acd2730e5ca57bb7f2c092942b6dd98997645b43350fd2c80051f3f8a6840f2746cd2e8fbeae862ab4cac0fc6339b7f298e697f3bfb4124598370c4b2a54
@@ -1 +0,0 @@
1
- 120956f03efbba5c9cec898b7da52efe
@@ -1 +0,0 @@
1
- b6c2c0740f1de17d7dc5671d096debbe7eb46dd3
@@ -1 +0,0 @@
1
- 8fdf9933acc2bcc22588bc3cffb6348ab73f8100c5212f7e607e315bce59a265
@@ -1 +0,0 @@
1
- f3ae74b6397013d7a5af6ed08cbbd739f5e207df9463a6b6cb496bd1b9a87022f193b87207d6424f2b8b85e022836211215cd01eaa88f9adcea6515594f59e76