@eggjs/mock 6.1.0-beta.3 → 6.1.0-beta.4

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.
Files changed (104) hide show
  1. package/dist/_virtual/rolldown_runtime.js +24 -1
  2. package/dist/bootstrap.d.ts +1 -1
  3. package/dist/bootstrap.js +1 -1
  4. package/dist/index.js +0 -1
  5. package/dist/inject_mocha.d.ts +1 -0
  6. package/dist/inject_mocha.js +35 -0
  7. package/dist/node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js +142 -0
  8. package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js +157 -0
  9. package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js +97 -0
  10. package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js +40 -0
  11. package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js +812 -0
  12. package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js +50 -0
  13. package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js +68 -0
  14. package/dist/node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js +752 -0
  15. package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/browser.js +203 -0
  16. package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/common.js +209 -0
  17. package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/index.js +18 -0
  18. package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/node.js +215 -0
  19. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/convert/dmp.js +24 -0
  20. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/convert/xml.js +33 -0
  21. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/array.js +29 -0
  22. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/base.js +185 -0
  23. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/character.js +23 -0
  24. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/css.js +26 -0
  25. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/json.js +83 -0
  26. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/line.js +51 -0
  27. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/sentence.js +26 -0
  28. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/word.js +151 -0
  29. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/index.js +178 -0
  30. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/apply.js +168 -0
  31. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/create.js +301 -0
  32. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/line-endings.js +137 -0
  33. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/merge.js +367 -0
  34. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/parse.js +91 -0
  35. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/reverse.js +99 -0
  36. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/array.js +23 -0
  37. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/distance-iterator.js +30 -0
  38. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/params.js +22 -0
  39. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/string.js +97 -0
  40. package/dist/node_modules/.pnpm/escape-string-regexp@4.0.0/node_modules/escape-string-regexp/index.js +14 -0
  41. package/dist/node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js +16 -0
  42. package/dist/node_modules/.pnpm/he@1.2.0/node_modules/he/he.js +4093 -0
  43. package/dist/node_modules/.pnpm/is-unicode-supported@0.1.0/node_modules/is-unicode-supported/index.js +14 -0
  44. package/dist/node_modules/.pnpm/log-symbols@4.1.0/node_modules/log-symbols/index.js +27 -0
  45. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/index.js +12 -0
  46. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/context.js +83 -0
  47. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/error-constants.js +35 -0
  48. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/errors.js +392 -0
  49. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/hook.js +86 -0
  50. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/bdd.js +104 -0
  51. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/common.js +99 -0
  52. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/exports.js +65 -0
  53. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/index.js +18 -0
  54. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/qunit.js +95 -0
  55. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/tdd.js +105 -0
  56. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/mocha.js +1037 -0
  57. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/mocharc.js +24 -0
  58. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/buffered-worker-pool.js +152 -0
  59. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/esm-utils.js +74 -0
  60. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/file-unloader.js +22 -0
  61. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/parallel-buffered-runner.js +329 -0
  62. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/serializer.js +314 -0
  63. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/pending.js +22 -0
  64. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/base.js +417 -0
  65. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/doc.js +79 -0
  66. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/dot.js +75 -0
  67. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/html.js +283 -0
  68. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/index.js +40 -0
  69. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/json-stream.js +90 -0
  70. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/json.js +145 -0
  71. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/landing.js +107 -0
  72. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/list.js +77 -0
  73. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/markdown.js +106 -0
  74. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/min.js +57 -0
  75. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/nyan.js +233 -0
  76. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/progress.js +92 -0
  77. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/spec.js +91 -0
  78. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/tap.js +261 -0
  79. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/xunit.js +166 -0
  80. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/runnable.js +346 -0
  81. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/runner.js +922 -0
  82. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/stats-collector.js +72 -0
  83. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/suite.js +517 -0
  84. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/test.js +105 -0
  85. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/utils.js +505 -0
  86. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/package.js +225 -0
  87. package/dist/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js +124 -0
  88. package/dist/node_modules/.pnpm/randombytes@2.1.0/node_modules/randombytes/index.js +11 -0
  89. package/dist/node_modules/.pnpm/serialize-javascript@6.0.2/node_modules/serialize-javascript/index.js +114 -0
  90. package/dist/node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js +76 -0
  91. package/dist/node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js +89 -0
  92. package/dist/node_modules/.pnpm/workerpool@9.3.3/node_modules/workerpool/src/Pool.js +366 -0
  93. package/dist/node_modules/.pnpm/workerpool@9.3.3/node_modules/workerpool/src/Promise.js +248 -0
  94. package/dist/node_modules/.pnpm/workerpool@9.3.3/node_modules/workerpool/src/WorkerHandler.js +419 -0
  95. package/dist/node_modules/.pnpm/workerpool@9.3.3/node_modules/workerpool/src/debug-port-allocator.js +27 -0
  96. package/dist/node_modules/.pnpm/workerpool@9.3.3/node_modules/workerpool/src/environment.js +18 -0
  97. package/dist/node_modules/.pnpm/workerpool@9.3.3/node_modules/workerpool/src/generated/embeddedWorker.js +16 -0
  98. package/dist/node_modules/.pnpm/workerpool@9.3.3/node_modules/workerpool/src/index.js +63 -0
  99. package/dist/node_modules/.pnpm/workerpool@9.3.3/node_modules/workerpool/src/transfer.js +21 -0
  100. package/dist/node_modules/.pnpm/workerpool@9.3.3/node_modules/workerpool/src/validateOptions.js +9 -0
  101. package/dist/node_modules/.pnpm/workerpool@9.3.3/node_modules/workerpool/src/worker.js +281 -0
  102. package/dist/register.d.ts +0 -2
  103. package/dist/register.js +1 -26
  104. package/package.json +10 -8
@@ -0,0 +1,346 @@
1
+ import { __commonJS, __require } from "../../../../../../_virtual/rolldown_runtime.js";
2
+ import { require_ms } from "../../../../ms@2.1.3/node_modules/ms/index.js";
3
+ import { require_utils } from "./utils.js";
4
+ import { require_pending } from "./pending.js";
5
+ import { require_src } from "../../../../debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/index.js";
6
+ import { require_errors } from "./errors.js";
7
+
8
+ //#region ../../node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/runnable.js
9
+ var require_runnable = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/runnable.js": ((exports, module) => {
10
+ var EventEmitter = __require("node:events").EventEmitter;
11
+ var Pending = require_pending();
12
+ var debug = require_src()("mocha:runnable");
13
+ var milliseconds = require_ms();
14
+ var utils = require_utils();
15
+ const { createInvalidExceptionError, createMultipleDoneError, createTimeoutError } = require_errors();
16
+ /**
17
+ * Save timer references to avoid Sinon interfering (see GH-237).
18
+ * @private
19
+ */
20
+ var Date = global.Date;
21
+ var setTimeout = global.setTimeout;
22
+ var clearTimeout = global.clearTimeout;
23
+ var toString = Object.prototype.toString;
24
+ var MAX_TIMEOUT = Math.pow(2, 31) - 1;
25
+ module.exports = Runnable;
26
+ /**
27
+ * Initialize a new `Runnable` with the given `title` and callback `fn`.
28
+ * Additional properties, like `getFullTitle()` and `slow()`, can be viewed in the `Runnable` source.
29
+ *
30
+ * @class
31
+ * @extends external:EventEmitter
32
+ * @public
33
+ * @param {String} title
34
+ * @param {Function} fn
35
+ */
36
+ function Runnable(title, fn) {
37
+ this.title = title;
38
+ this.fn = fn;
39
+ this.body = (fn || "").toString();
40
+ this.async = fn && fn.length;
41
+ this.sync = !this.async;
42
+ this._timeout = 2e3;
43
+ this._slow = 75;
44
+ this._retries = -1;
45
+ utils.assignNewMochaID(this);
46
+ Object.defineProperty(this, "id", { get() {
47
+ return utils.getMochaID(this);
48
+ } });
49
+ this.reset();
50
+ }
51
+ /**
52
+ * Inherit from `EventEmitter.prototype`.
53
+ */
54
+ utils.inherits(Runnable, EventEmitter);
55
+ /**
56
+ * Resets the state initially or for a next run.
57
+ */
58
+ Runnable.prototype.reset = function() {
59
+ this.timedOut = false;
60
+ this._currentRetry = 0;
61
+ this.pending = false;
62
+ delete this.state;
63
+ delete this.err;
64
+ };
65
+ /**
66
+ * Get current timeout value in msecs.
67
+ *
68
+ * @private
69
+ * @returns {number} current timeout threshold value
70
+ */
71
+ /**
72
+ * @summary
73
+ * Set timeout threshold value (msecs).
74
+ *
75
+ * @description
76
+ * A string argument can use shorthand (e.g., "2s") and will be converted.
77
+ * The value will be clamped to range [<code>0</code>, <code>2^<sup>31</sup>-1</code>].
78
+ * If clamped value matches either range endpoint, timeouts will be disabled.
79
+ *
80
+ * @private
81
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout#Maximum_delay_value}
82
+ * @param {number|string} ms - Timeout threshold value.
83
+ * @returns {Runnable} this
84
+ * @chainable
85
+ */
86
+ Runnable.prototype.timeout = function(ms) {
87
+ if (!arguments.length) return this._timeout;
88
+ if (typeof ms === "string") ms = milliseconds(ms);
89
+ var range = [0, MAX_TIMEOUT];
90
+ ms = utils.clamp(ms, range);
91
+ if (ms === range[0] || ms === range[1]) this._timeout = 0;
92
+ else this._timeout = ms;
93
+ debug("timeout %d", this._timeout);
94
+ if (this.timer) this.resetTimeout();
95
+ return this;
96
+ };
97
+ /**
98
+ * Set or get slow `ms`.
99
+ *
100
+ * @private
101
+ * @param {number|string} ms
102
+ * @return {Runnable|number} ms or Runnable instance.
103
+ */
104
+ Runnable.prototype.slow = function(ms) {
105
+ if (!arguments.length || typeof ms === "undefined") return this._slow;
106
+ if (typeof ms === "string") ms = milliseconds(ms);
107
+ debug("slow %d", ms);
108
+ this._slow = ms;
109
+ return this;
110
+ };
111
+ /**
112
+ * Halt and mark as pending.
113
+ *
114
+ * @memberof Mocha.Runnable
115
+ * @public
116
+ */
117
+ Runnable.prototype.skip = function() {
118
+ this.pending = true;
119
+ throw new Pending("sync skip; aborting execution");
120
+ };
121
+ /**
122
+ * Check if this runnable or its parent suite is marked as pending.
123
+ *
124
+ * @private
125
+ */
126
+ Runnable.prototype.isPending = function() {
127
+ return this.pending || this.parent && this.parent.isPending();
128
+ };
129
+ /**
130
+ * Return `true` if this Runnable has failed.
131
+ * @return {boolean}
132
+ * @private
133
+ */
134
+ Runnable.prototype.isFailed = function() {
135
+ return !this.isPending() && this.state === constants.STATE_FAILED;
136
+ };
137
+ /**
138
+ * Return `true` if this Runnable has passed.
139
+ * @return {boolean}
140
+ * @private
141
+ */
142
+ Runnable.prototype.isPassed = function() {
143
+ return !this.isPending() && this.state === constants.STATE_PASSED;
144
+ };
145
+ /**
146
+ * Set or get number of retries.
147
+ *
148
+ * @private
149
+ */
150
+ Runnable.prototype.retries = function(n) {
151
+ if (!arguments.length) return this._retries;
152
+ this._retries = n;
153
+ };
154
+ /**
155
+ * Set or get current retry
156
+ *
157
+ * @private
158
+ */
159
+ Runnable.prototype.currentRetry = function(n) {
160
+ if (!arguments.length) return this._currentRetry;
161
+ this._currentRetry = n;
162
+ };
163
+ /**
164
+ * Return the full title generated by recursively concatenating the parent's
165
+ * full title.
166
+ *
167
+ * @memberof Mocha.Runnable
168
+ * @public
169
+ * @return {string}
170
+ */
171
+ Runnable.prototype.fullTitle = function() {
172
+ return this.titlePath().join(" ");
173
+ };
174
+ /**
175
+ * Return the title path generated by concatenating the parent's title path with the title.
176
+ *
177
+ * @memberof Mocha.Runnable
178
+ * @public
179
+ * @return {string[]}
180
+ */
181
+ Runnable.prototype.titlePath = function() {
182
+ return this.parent.titlePath().concat([this.title]);
183
+ };
184
+ /**
185
+ * Clear the timeout.
186
+ *
187
+ * @private
188
+ */
189
+ Runnable.prototype.clearTimeout = function() {
190
+ clearTimeout(this.timer);
191
+ };
192
+ /**
193
+ * Reset the timeout.
194
+ *
195
+ * @private
196
+ */
197
+ Runnable.prototype.resetTimeout = function() {
198
+ var self = this;
199
+ var ms = this.timeout() || MAX_TIMEOUT;
200
+ this.clearTimeout();
201
+ this.timer = setTimeout(function() {
202
+ if (self.timeout() === 0) return;
203
+ self.callback(self._timeoutError(ms));
204
+ self.timedOut = true;
205
+ }, ms);
206
+ };
207
+ /**
208
+ * Set or get a list of whitelisted globals for this test run.
209
+ *
210
+ * @private
211
+ * @param {string[]} globals
212
+ */
213
+ Runnable.prototype.globals = function(globals) {
214
+ if (!arguments.length) return this._allowedGlobals;
215
+ this._allowedGlobals = globals;
216
+ };
217
+ /**
218
+ * Run the test and invoke `fn(err)`.
219
+ *
220
+ * @param {Function} fn
221
+ * @private
222
+ */
223
+ Runnable.prototype.run = function(fn) {
224
+ var self = this;
225
+ var start = new Date();
226
+ var ctx = this.ctx;
227
+ var finished;
228
+ var errorWasHandled = false;
229
+ if (this.isPending()) return fn();
230
+ if (ctx && ctx.runnable) ctx.runnable(this);
231
+ function multiple(err) {
232
+ if (errorWasHandled) return;
233
+ errorWasHandled = true;
234
+ self.emit("error", createMultipleDoneError(self, err));
235
+ }
236
+ function done(err) {
237
+ var ms = self.timeout();
238
+ if (self.timedOut) return;
239
+ if (finished) return multiple(err);
240
+ self.clearTimeout();
241
+ self.duration = new Date() - start;
242
+ finished = true;
243
+ if (!err && self.duration > ms && ms > 0) err = self._timeoutError(ms);
244
+ fn(err);
245
+ }
246
+ this.callback = done;
247
+ if (this.fn && typeof this.fn.call !== "function") {
248
+ done(/* @__PURE__ */ new TypeError("A runnable must be passed a function as its second argument."));
249
+ return;
250
+ }
251
+ if (this.async) {
252
+ this.resetTimeout();
253
+ this.skip = function asyncSkip() {
254
+ this.pending = true;
255
+ done();
256
+ throw new Pending("async skip; aborting execution");
257
+ };
258
+ try {
259
+ callFnAsync(this.fn);
260
+ } catch (err) {
261
+ errorWasHandled = true;
262
+ if (err instanceof Pending) return;
263
+ else if (this.allowUncaught) throw err;
264
+ done(Runnable.toValueOrError(err));
265
+ }
266
+ return;
267
+ }
268
+ try {
269
+ callFn(this.fn);
270
+ } catch (err) {
271
+ errorWasHandled = true;
272
+ if (err instanceof Pending) return done();
273
+ else if (this.allowUncaught) throw err;
274
+ done(Runnable.toValueOrError(err));
275
+ }
276
+ function callFn(fn$1) {
277
+ var result = fn$1.call(ctx);
278
+ if (result && typeof result.then === "function") {
279
+ self.resetTimeout();
280
+ result.then(function() {
281
+ done();
282
+ return null;
283
+ }, function(reason) {
284
+ done(reason || /* @__PURE__ */ new Error("Promise rejected with no or falsy reason"));
285
+ });
286
+ } else {
287
+ if (self.asyncOnly) return done(/* @__PURE__ */ new Error("--async-only option in use without declaring `done()` or returning a promise"));
288
+ done();
289
+ }
290
+ }
291
+ function callFnAsync(fn$1) {
292
+ var result = fn$1.call(ctx, function(err) {
293
+ if (err instanceof Error || toString.call(err) === "[object Error]") return done(err);
294
+ if (err) {
295
+ if (Object.prototype.toString.call(err) === "[object Object]") return done(/* @__PURE__ */ new Error("done() invoked with non-Error: " + JSON.stringify(err)));
296
+ return done(/* @__PURE__ */ new Error("done() invoked with non-Error: " + err));
297
+ }
298
+ if (result && utils.isPromise(result)) return done(/* @__PURE__ */ new Error("Resolution method is overspecified. Specify a callback *or* return a Promise; not both."));
299
+ done();
300
+ });
301
+ }
302
+ };
303
+ /**
304
+ * Instantiates a "timeout" error
305
+ *
306
+ * @param {number} ms - Timeout (in milliseconds)
307
+ * @returns {Error} a "timeout" error
308
+ * @private
309
+ */
310
+ Runnable.prototype._timeoutError = function(ms) {
311
+ let msg = `Timeout of ${ms}ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.`;
312
+ if (this.file) msg += " (" + this.file + ")";
313
+ return createTimeoutError(msg, ms, this.file);
314
+ };
315
+ var constants = utils.defineConstants(
316
+ /**
317
+ * {@link Runnable}-related constants.
318
+ * @public
319
+ * @memberof Runnable
320
+ * @readonly
321
+ * @static
322
+ * @alias constants
323
+ * @enum {string}
324
+ */
325
+ {
326
+ STATE_FAILED: "failed",
327
+ STATE_PASSED: "passed",
328
+ STATE_PENDING: "pending"
329
+ }
330
+ );
331
+ /**
332
+ * Given `value`, return identity if truthy, otherwise create an "invalid exception" error and return that.
333
+ * @param {*} [value] - Value to return, if present
334
+ * @returns {*|Error} `value`, otherwise an `Error`
335
+ * @private
336
+ */
337
+ Runnable.toValueOrError = function(value) {
338
+ return value || createInvalidExceptionError("Runnable failed with falsy or undefined exception. Please throw an Error instead.", value);
339
+ };
340
+ Runnable.constants = constants;
341
+ }) });
342
+
343
+ //#endregion
344
+ export default require_runnable();
345
+
346
+ export { require_runnable };