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

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.4/node_modules/workerpool/src/Pool.js +366 -0
  93. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/Promise.js +248 -0
  94. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/WorkerHandler.js +419 -0
  95. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/debug-port-allocator.js +27 -0
  96. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/environment.js +18 -0
  97. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/generated/embeddedWorker.js +16 -0
  98. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/index.js +63 -0
  99. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/transfer.js +21 -0
  100. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/validateOptions.js +9 -0
  101. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/worker.js +277 -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,277 @@
1
+ import { __commonJS, __require } from "../../../../../../_virtual/rolldown_runtime.js";
2
+ import { require_Promise } from "./Promise.js";
3
+ import { require_transfer } from "./transfer.js";
4
+
5
+ //#region ../../node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/worker.js
6
+ var require_worker = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/worker.js": ((exports) => {
7
+ /**
8
+ * worker must be started as a child process or a web worker.
9
+ * It listens for RPC messages from the parent process.
10
+ */
11
+ var Transfer = require_transfer();
12
+ /**
13
+ * worker must handle async cleanup handlers. Use custom Promise implementation.
14
+ */
15
+ var Promise$1 = require_Promise().Promise;
16
+ /**
17
+ * Special message sent by parent which causes the worker to terminate itself.
18
+ * Not a "message object"; this string is the entire message.
19
+ */
20
+ var TERMINATE_METHOD_ID = "__workerpool-terminate__";
21
+ /**
22
+ * Special message by parent which causes a child process worker to perform cleaup
23
+ * steps before determining if the child process worker should be terminated.
24
+ */
25
+ var CLEANUP_METHOD_ID = "__workerpool-cleanup__";
26
+ var TIMEOUT_DEFAULT = 1e3;
27
+ var worker = { exit: function() {} };
28
+ var publicWorker = {
29
+ addAbortListener: function(listener) {
30
+ worker.abortListeners.push(listener);
31
+ },
32
+ emit: worker.emit
33
+ };
34
+ if (typeof self !== "undefined" && typeof postMessage === "function" && typeof addEventListener === "function") {
35
+ worker.on = function(event, callback) {
36
+ addEventListener(event, function(message) {
37
+ callback(message.data);
38
+ });
39
+ };
40
+ worker.send = function(message, transfer) {
41
+ transfer ? postMessage(message, transfer) : postMessage(message);
42
+ };
43
+ } else if (typeof process !== "undefined") {
44
+ var WorkerThreads;
45
+ try {
46
+ WorkerThreads = __require("worker_threads");
47
+ } catch (error) {
48
+ if (typeof error === "object" && error !== null && error.code === "MODULE_NOT_FOUND") {} else throw error;
49
+ }
50
+ if (WorkerThreads && WorkerThreads.parentPort !== null) {
51
+ var parentPort = WorkerThreads.parentPort;
52
+ worker.send = parentPort.postMessage.bind(parentPort);
53
+ worker.on = parentPort.on.bind(parentPort);
54
+ worker.exit = process.exit.bind(process);
55
+ } else {
56
+ worker.on = process.on.bind(process);
57
+ worker.send = function(message) {
58
+ process.send(message);
59
+ };
60
+ worker.on("disconnect", function() {
61
+ process.exit(1);
62
+ });
63
+ worker.exit = process.exit.bind(process);
64
+ }
65
+ } else throw new Error("Script must be executed as a worker");
66
+ function convertError(error) {
67
+ if (error && error.toJSON) return JSON.parse(JSON.stringify(error));
68
+ return JSON.parse(JSON.stringify(error, Object.getOwnPropertyNames(error)));
69
+ }
70
+ /**
71
+ * Test whether a value is a Promise via duck typing.
72
+ * @param {*} value
73
+ * @returns {boolean} Returns true when given value is an object
74
+ * having functions `then` and `catch`.
75
+ */
76
+ function isPromise(value) {
77
+ return value && typeof value.then === "function" && typeof value.catch === "function";
78
+ }
79
+ worker.methods = {};
80
+ /**
81
+ * Execute a function with provided arguments
82
+ * @param {String} fn Stringified function
83
+ * @param {Array} [args] Function arguments
84
+ * @returns {*}
85
+ */
86
+ worker.methods.run = function run(fn, args) {
87
+ var f = new Function("return (" + fn + ").apply(this, arguments);");
88
+ f.worker = publicWorker;
89
+ return f.apply(f, args);
90
+ };
91
+ /**
92
+ * Get a list with methods available on this worker
93
+ * @return {String[]} methods
94
+ */
95
+ worker.methods.methods = function methods() {
96
+ return Object.keys(worker.methods);
97
+ };
98
+ /**
99
+ * Custom handler for when the worker is terminated.
100
+ */
101
+ worker.terminationHandler = void 0;
102
+ worker.abortListenerTimeout = TIMEOUT_DEFAULT;
103
+ /**
104
+ * Abort handlers for resolving errors which may cause a timeout or cancellation
105
+ * to occur from a worker context
106
+ */
107
+ worker.abortListeners = [];
108
+ /**
109
+ * Cleanup and exit the worker.
110
+ * @param {Number} code
111
+ * @returns {Promise<void>}
112
+ */
113
+ worker.terminateAndExit = function(code) {
114
+ var _exit = function() {
115
+ worker.exit(code);
116
+ };
117
+ if (!worker.terminationHandler) return _exit();
118
+ var result = worker.terminationHandler(code);
119
+ if (isPromise(result)) {
120
+ result.then(_exit, _exit);
121
+ return result;
122
+ } else {
123
+ _exit();
124
+ return new Promise$1(function(_resolve, reject) {
125
+ reject(/* @__PURE__ */ new Error("Worker terminating"));
126
+ });
127
+ }
128
+ };
129
+ /**
130
+ * Called within the worker message handler to run abort handlers if registered to perform cleanup operations.
131
+ * @param {Integer} [requestId] id of task which is currently executing in the worker
132
+ * @return {Promise<void>}
133
+ */
134
+ worker.cleanup = function(requestId) {
135
+ if (!worker.abortListeners.length) {
136
+ worker.send({
137
+ id: requestId,
138
+ method: CLEANUP_METHOD_ID,
139
+ error: convertError(/* @__PURE__ */ new Error("Worker terminating"))
140
+ });
141
+ return new Promise$1(function(resolve) {
142
+ resolve();
143
+ });
144
+ }
145
+ var _exit = function() {
146
+ worker.exit();
147
+ };
148
+ var _abort = function() {
149
+ if (!worker.abortListeners.length) worker.abortListeners = [];
150
+ };
151
+ const promises = worker.abortListeners.map((listener) => listener());
152
+ let timerId;
153
+ const timeoutPromise = new Promise$1((_resolve, reject) => {
154
+ timerId = setTimeout(function() {
155
+ reject(/* @__PURE__ */ new Error("Timeout occured waiting for abort handler, killing worker"));
156
+ }, worker.abortListenerTimeout);
157
+ });
158
+ const settlePromise = Promise$1.all(promises).then(function() {
159
+ clearTimeout(timerId);
160
+ _abort();
161
+ }, function() {
162
+ clearTimeout(timerId);
163
+ _exit();
164
+ });
165
+ return new Promise$1(function(resolve, reject) {
166
+ settlePromise.then(resolve, reject);
167
+ timeoutPromise.then(resolve, reject);
168
+ }).then(function() {
169
+ worker.send({
170
+ id: requestId,
171
+ method: CLEANUP_METHOD_ID,
172
+ error: null
173
+ });
174
+ }, function(err) {
175
+ worker.send({
176
+ id: requestId,
177
+ method: CLEANUP_METHOD_ID,
178
+ error: err ? convertError(err) : null
179
+ });
180
+ });
181
+ };
182
+ var currentRequestId = null;
183
+ worker.on("message", function(request) {
184
+ if (request === TERMINATE_METHOD_ID) return worker.terminateAndExit(0);
185
+ if (request.method === CLEANUP_METHOD_ID) return worker.cleanup(request.id);
186
+ try {
187
+ var method = worker.methods[request.method];
188
+ if (method) {
189
+ currentRequestId = request.id;
190
+ var result = method.apply(method, request.params);
191
+ if (isPromise(result)) result.then(function(result$1) {
192
+ if (result$1 instanceof Transfer) worker.send({
193
+ id: request.id,
194
+ result: result$1.message,
195
+ error: null
196
+ }, result$1.transfer);
197
+ else worker.send({
198
+ id: request.id,
199
+ result: result$1,
200
+ error: null
201
+ });
202
+ currentRequestId = null;
203
+ }).catch(function(err) {
204
+ worker.send({
205
+ id: request.id,
206
+ result: null,
207
+ error: convertError(err)
208
+ });
209
+ currentRequestId = null;
210
+ });
211
+ else {
212
+ if (result instanceof Transfer) worker.send({
213
+ id: request.id,
214
+ result: result.message,
215
+ error: null
216
+ }, result.transfer);
217
+ else worker.send({
218
+ id: request.id,
219
+ result,
220
+ error: null
221
+ });
222
+ currentRequestId = null;
223
+ }
224
+ } else throw new Error("Unknown method \"" + request.method + "\"");
225
+ } catch (err) {
226
+ worker.send({
227
+ id: request.id,
228
+ result: null,
229
+ error: convertError(err)
230
+ });
231
+ }
232
+ });
233
+ /**
234
+ * Register methods to the worker
235
+ * @param {Object} [methods]
236
+ * @param {import('./types.js').WorkerRegisterOptions} [options]
237
+ */
238
+ worker.register = function(methods, options) {
239
+ if (methods) {
240
+ for (var name in methods) if (methods.hasOwnProperty(name)) {
241
+ worker.methods[name] = methods[name];
242
+ worker.methods[name].worker = publicWorker;
243
+ }
244
+ }
245
+ if (options) {
246
+ worker.terminationHandler = options.onTerminate;
247
+ worker.abortListenerTimeout = options.abortListenerTimeout || TIMEOUT_DEFAULT;
248
+ }
249
+ worker.send("ready");
250
+ };
251
+ worker.emit = function(payload) {
252
+ if (currentRequestId) {
253
+ if (payload instanceof Transfer) {
254
+ worker.send({
255
+ id: currentRequestId,
256
+ isEvent: true,
257
+ payload: payload.message
258
+ }, payload.transfer);
259
+ return;
260
+ }
261
+ worker.send({
262
+ id: currentRequestId,
263
+ isEvent: true,
264
+ payload
265
+ });
266
+ }
267
+ };
268
+ if (typeof exports !== "undefined") {
269
+ exports.add = worker.register;
270
+ exports.emit = worker.emit;
271
+ }
272
+ }) });
273
+
274
+ //#endregion
275
+ export default require_worker();
276
+
277
+ export { require_worker };
@@ -1,5 +1,3 @@
1
- import "mocha";
2
-
3
1
  //#region src/register.d.ts
4
2
  declare function mochaGlobalSetup(): Promise<void>;
5
3
  declare function mochaGlobalTeardown(): Promise<void>;
package/dist/register.js CHANGED
@@ -1,11 +1,8 @@
1
- import { __require } from "./_virtual/rolldown_runtime.js";
2
1
  import { closeAgent, setupAgent } from "./lib/agent_handler.js";
3
2
  import { getApp } from "./lib/app_handler.js";
4
3
  import { mm as proxyMock } from "./index.js";
5
- import { injectContext } from "./lib/inject_context.js";
6
- import { createRequire } from "node:module";
4
+ import "./inject_mocha.js";
7
5
  import { debuglog } from "node:util";
8
- import "mocha";
9
6
 
10
7
  //#region src/register.ts
11
8
  const debug = debuglog("egg/mock/register");
@@ -38,28 +35,6 @@ const mochaHooks = {
38
35
  if (app) await app.close();
39
36
  }
40
37
  };
41
- /**
42
- * Find active node mocha instances.
43
- */
44
- function findNodeJSMocha() {
45
- let children;
46
- if (typeof __require === "function") children = __require.cache || {};
47
- else {
48
- children = createRequire(process.cwd()).cache || {};
49
- debug("createRequire on esm");
50
- }
51
- return Object.keys(children).filter(function(child) {
52
- const val = children[child].exports;
53
- return typeof val === "function" && val.name === "Mocha";
54
- }).map(function(child) {
55
- return children[child].exports;
56
- });
57
- }
58
- const modules = findNodeJSMocha();
59
- for (const module of modules) {
60
- if (!module) continue;
61
- injectContext(module);
62
- }
63
38
 
64
39
  //#endregion
65
40
  export { mochaGlobalSetup, mochaGlobalTeardown, mochaHooks };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eggjs/mock",
3
- "version": "6.1.0-beta.3",
3
+ "version": "6.1.0-beta.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -18,6 +18,7 @@
18
18
  "./app/extend/application": "./dist/app/extend/application.js",
19
19
  "./app/middleware/cluster_app_mock": "./dist/app/middleware/cluster_app_mock.js",
20
20
  "./bootstrap": "./dist/bootstrap.js",
21
+ "./inject_mocha": "./dist/inject_mocha.js",
21
22
  "./lib/agent_handler": "./dist/lib/agent_handler.js",
22
23
  "./lib/app": "./dist/lib/app.js",
23
24
  "./lib/app_handler": "./dist/lib/app_handler.js",
@@ -64,7 +65,6 @@
64
65
  "node": ">= 20.19.0"
65
66
  },
66
67
  "dependencies": {
67
- "@eggjs/supertest": "",
68
68
  "coffee": "5",
69
69
  "detect-port": "^2.1.0",
70
70
  "egg-logger": "^3.5.0",
@@ -76,9 +76,10 @@
76
76
  "sdk-base": "^5.0.1",
77
77
  "urllib": "^4.6.11",
78
78
  "utility": "^2.5.0",
79
- "@eggjs/core": "6.6.0-beta.3",
80
- "@eggjs/utils": "4.5.0-beta.3",
81
- "@eggjs/extend2": "4.1.0-beta.3"
79
+ "@eggjs/core": "6.6.0-beta.5",
80
+ "@eggjs/extend2": "4.1.0-beta.5",
81
+ "@eggjs/supertest": "8.3.0-beta.5",
82
+ "@eggjs/utils": "4.5.0-beta.5"
82
83
  },
83
84
  "devDependencies": {
84
85
  "@eggjs/tegg": "^3.2.2",
@@ -92,13 +93,14 @@
92
93
  "pedding": "^2.0.1",
93
94
  "tsd": "^0.33.0",
94
95
  "tsdown": "^0.15.0",
95
- "typescript": "5",
96
- "egg": "4.1.0-beta.3",
97
- "@eggjs/tsconfig": "3.1.0-beta.3"
96
+ "typescript": "5.9.2",
97
+ "@eggjs/tsconfig": "3.1.0-beta.5",
98
+ "egg": "4.1.0-beta.5"
98
99
  },
99
100
  "scripts": {
100
101
  "build": "tsdown",
101
102
  "lint": "oxlint",
103
+ "typecheck": "tsc --noEmit",
102
104
  "test": "vitest run"
103
105
  }
104
106
  }