@eggjs/mock 6.1.0-beta.9 → 7.0.0-beta.14

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/README.md +1 -1
  2. package/README.zh_CN.md +1 -1
  3. package/dist/_virtual/rolldown_runtime.js +1 -24
  4. package/dist/inject_mocha.d.ts +1 -1
  5. package/dist/inject_mocha.js +2 -3
  6. package/dist/lib/app.js +4 -1
  7. package/dist/lib/context.js +1 -3
  8. package/dist/lib/types.d.ts +4 -0
  9. package/package.json +9 -13
  10. package/dist/node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js +0 -142
  11. package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js +0 -157
  12. package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js +0 -97
  13. package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js +0 -40
  14. package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js +0 -814
  15. package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js +0 -50
  16. package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js +0 -68
  17. package/dist/node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js +0 -752
  18. package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/browser.js +0 -203
  19. package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/common.js +0 -209
  20. package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/index.js +0 -18
  21. package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/node.js +0 -215
  22. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/convert/dmp.js +0 -24
  23. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/convert/xml.js +0 -33
  24. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/array.js +0 -29
  25. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/base.js +0 -185
  26. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/character.js +0 -23
  27. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/css.js +0 -26
  28. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/json.js +0 -83
  29. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/line.js +0 -51
  30. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/sentence.js +0 -26
  31. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/word.js +0 -151
  32. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/index.js +0 -178
  33. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/apply.js +0 -168
  34. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/create.js +0 -301
  35. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/line-endings.js +0 -137
  36. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/merge.js +0 -367
  37. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/parse.js +0 -91
  38. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/reverse.js +0 -99
  39. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/array.js +0 -23
  40. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/distance-iterator.js +0 -30
  41. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/params.js +0 -22
  42. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/string.js +0 -97
  43. package/dist/node_modules/.pnpm/escape-string-regexp@4.0.0/node_modules/escape-string-regexp/index.js +0 -14
  44. package/dist/node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js +0 -16
  45. package/dist/node_modules/.pnpm/he@1.2.0/node_modules/he/he.js +0 -4093
  46. package/dist/node_modules/.pnpm/is-unicode-supported@0.1.0/node_modules/is-unicode-supported/index.js +0 -14
  47. package/dist/node_modules/.pnpm/log-symbols@4.1.0/node_modules/log-symbols/index.js +0 -27
  48. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/index.js +0 -12
  49. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/context.js +0 -83
  50. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/error-constants.js +0 -35
  51. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/errors.js +0 -392
  52. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/hook.js +0 -86
  53. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/bdd.js +0 -104
  54. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/common.js +0 -99
  55. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/exports.js +0 -65
  56. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/index.js +0 -18
  57. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/qunit.js +0 -95
  58. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/tdd.js +0 -105
  59. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/mocha.js +0 -1037
  60. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/mocharc.js +0 -24
  61. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/buffered-worker-pool.js +0 -152
  62. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/esm-utils.js +0 -74
  63. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/file-unloader.js +0 -22
  64. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/parallel-buffered-runner.js +0 -329
  65. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/serializer.js +0 -314
  66. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/pending.js +0 -22
  67. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/base.js +0 -417
  68. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/doc.js +0 -79
  69. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/dot.js +0 -75
  70. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/html.js +0 -283
  71. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/index.js +0 -40
  72. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/json-stream.js +0 -90
  73. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/json.js +0 -145
  74. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/landing.js +0 -107
  75. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/list.js +0 -77
  76. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/markdown.js +0 -106
  77. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/min.js +0 -57
  78. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/nyan.js +0 -233
  79. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/progress.js +0 -92
  80. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/spec.js +0 -91
  81. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/tap.js +0 -261
  82. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/xunit.js +0 -166
  83. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/runnable.js +0 -346
  84. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/runner.js +0 -922
  85. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/stats-collector.js +0 -72
  86. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/suite.js +0 -517
  87. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/test.js +0 -105
  88. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/utils.js +0 -505
  89. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/package.js +0 -225
  90. package/dist/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js +0 -124
  91. package/dist/node_modules/.pnpm/randombytes@2.1.0/node_modules/randombytes/index.js +0 -11
  92. package/dist/node_modules/.pnpm/serialize-javascript@6.0.2/node_modules/serialize-javascript/index.js +0 -114
  93. package/dist/node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js +0 -76
  94. package/dist/node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js +0 -89
  95. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/Pool.js +0 -366
  96. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/Promise.js +0 -248
  97. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/WorkerHandler.js +0 -419
  98. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/debug-port-allocator.js +0 -27
  99. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/environment.js +0 -18
  100. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/generated/embeddedWorker.js +0 -16
  101. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/index.js +0 -63
  102. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/transfer.js +0 -21
  103. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/validateOptions.js +0 -9
  104. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/worker.js +0 -277
@@ -1,23 +0,0 @@
1
- import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
2
-
3
- //#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/array.js
4
- var require_array = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/array.js": ((exports) => {
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.arrayEqual = arrayEqual;
7
- exports.arrayStartsWith = arrayStartsWith;
8
- /*istanbul ignore end*/
9
- function arrayEqual(a, b) {
10
- if (a.length !== b.length) return false;
11
- return arrayStartsWith(a, b);
12
- }
13
- function arrayStartsWith(array, start) {
14
- if (start.length > array.length) return false;
15
- for (var i = 0; i < start.length; i++) if (start[i] !== array[i]) return false;
16
- return true;
17
- }
18
- }) });
19
-
20
- //#endregion
21
- export default require_array();
22
-
23
- export { require_array };
@@ -1,30 +0,0 @@
1
- import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
2
-
3
- //#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/distance-iterator.js
4
- var require_distance_iterator = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/distance-iterator.js": ((exports) => {
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports["default"] = _default;
7
- /*istanbul ignore end*/
8
- function _default(start, minLine, maxLine) {
9
- var wantForward = true, backwardExhausted = false, forwardExhausted = false, localOffset = 1;
10
- return function iterator() {
11
- if (wantForward && !forwardExhausted) {
12
- if (backwardExhausted) localOffset++;
13
- else wantForward = false;
14
- if (start + localOffset <= maxLine) return start + localOffset;
15
- forwardExhausted = true;
16
- }
17
- if (!backwardExhausted) {
18
- if (!forwardExhausted) wantForward = true;
19
- if (minLine <= start - localOffset) return start - localOffset++;
20
- backwardExhausted = true;
21
- return iterator();
22
- }
23
- };
24
- }
25
- }) });
26
-
27
- //#endregion
28
- export default require_distance_iterator();
29
-
30
- export { require_distance_iterator };
@@ -1,22 +0,0 @@
1
- import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
2
-
3
- //#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/params.js
4
- var require_params = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/params.js": ((exports) => {
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.generateOptions = generateOptions;
7
- /*istanbul ignore end*/
8
- function generateOptions(options, defaults) {
9
- if (typeof options === "function") defaults.callback = options;
10
- else if (options) {
11
- for (var name in options)
12
- /* istanbul ignore else */
13
- if (options.hasOwnProperty(name)) defaults[name] = options[name];
14
- }
15
- return defaults;
16
- }
17
- }) });
18
-
19
- //#endregion
20
- export default require_params();
21
-
22
- export { require_params };
@@ -1,97 +0,0 @@
1
- import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
2
-
3
- //#region ../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/string.js
4
- var require_string = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/string.js": ((exports) => {
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.hasOnlyUnixLineEndings = hasOnlyUnixLineEndings;
7
- exports.hasOnlyWinLineEndings = hasOnlyWinLineEndings;
8
- exports.longestCommonPrefix = longestCommonPrefix;
9
- exports.longestCommonSuffix = longestCommonSuffix;
10
- exports.maximumOverlap = maximumOverlap;
11
- exports.removePrefix = removePrefix;
12
- exports.removeSuffix = removeSuffix;
13
- exports.replacePrefix = replacePrefix;
14
- exports.replaceSuffix = replaceSuffix;
15
- /*istanbul ignore end*/
16
- function longestCommonPrefix(str1, str2) {
17
- var i;
18
- for (i = 0; i < str1.length && i < str2.length; i++) if (str1[i] != str2[i]) return str1.slice(0, i);
19
- return str1.slice(0, i);
20
- }
21
- function longestCommonSuffix(str1, str2) {
22
- var i;
23
- if (!str1 || !str2 || str1[str1.length - 1] != str2[str2.length - 1]) return "";
24
- for (i = 0; i < str1.length && i < str2.length; i++) if (str1[str1.length - (i + 1)] != str2[str2.length - (i + 1)]) return str1.slice(-i);
25
- return str1.slice(-i);
26
- }
27
- function replacePrefix(string, oldPrefix, newPrefix) {
28
- if (string.slice(0, oldPrefix.length) != oldPrefix) throw Error(
29
- /*istanbul ignore start*/
30
- "string ".concat(
31
- /*istanbul ignore end*/
32
- JSON.stringify(string),
33
- " doesn't start with prefix "
34
- ).concat(JSON.stringify(oldPrefix), "; this is a bug")
35
- );
36
- return newPrefix + string.slice(oldPrefix.length);
37
- }
38
- function replaceSuffix(string, oldSuffix, newSuffix) {
39
- if (!oldSuffix) return string + newSuffix;
40
- if (string.slice(-oldSuffix.length) != oldSuffix) throw Error(
41
- /*istanbul ignore start*/
42
- "string ".concat(
43
- /*istanbul ignore end*/
44
- JSON.stringify(string),
45
- " doesn't end with suffix "
46
- ).concat(JSON.stringify(oldSuffix), "; this is a bug")
47
- );
48
- return string.slice(0, -oldSuffix.length) + newSuffix;
49
- }
50
- function removePrefix(string, oldPrefix) {
51
- return replacePrefix(string, oldPrefix, "");
52
- }
53
- function removeSuffix(string, oldSuffix) {
54
- return replaceSuffix(string, oldSuffix, "");
55
- }
56
- function maximumOverlap(string1, string2) {
57
- return string2.slice(0, overlapCount(string1, string2));
58
- }
59
- function overlapCount(a, b) {
60
- var startA = 0;
61
- if (a.length > b.length) startA = a.length - b.length;
62
- var endB = b.length;
63
- if (a.length < b.length) endB = a.length;
64
- var map = Array(endB);
65
- var k = 0;
66
- map[0] = 0;
67
- for (var j = 1; j < endB; j++) {
68
- if (b[j] == b[k]) map[j] = map[k];
69
- else map[j] = k;
70
- while (k > 0 && b[j] != b[k]) k = map[k];
71
- if (b[j] == b[k]) k++;
72
- }
73
- k = 0;
74
- for (var i = startA; i < a.length; i++) {
75
- while (k > 0 && a[i] != b[k]) k = map[k];
76
- if (a[i] == b[k]) k++;
77
- }
78
- return k;
79
- }
80
- /**
81
- * Returns true if the string consistently uses Windows line endings.
82
- */
83
- function hasOnlyWinLineEndings(string) {
84
- return string.includes("\r\n") && !string.startsWith("\n") && !string.match(/[^\r]\n/);
85
- }
86
- /**
87
- * Returns true if the string consistently uses Unix line endings.
88
- */
89
- function hasOnlyUnixLineEndings(string) {
90
- return !string.includes("\r\n") && string.includes("\n");
91
- }
92
- }) });
93
-
94
- //#endregion
95
- export default require_string();
96
-
97
- export { require_string };
@@ -1,14 +0,0 @@
1
- import { __commonJS } from "../../../../../_virtual/rolldown_runtime.js";
2
-
3
- //#region ../../node_modules/.pnpm/escape-string-regexp@4.0.0/node_modules/escape-string-regexp/index.js
4
- var require_escape_string_regexp = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/escape-string-regexp@4.0.0/node_modules/escape-string-regexp/index.js": ((exports, module) => {
5
- module.exports = (string) => {
6
- if (typeof string !== "string") throw new TypeError("Expected a string");
7
- return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
8
- };
9
- }) });
10
-
11
- //#endregion
12
- export default require_escape_string_regexp();
13
-
14
- export { require_escape_string_regexp };
@@ -1,16 +0,0 @@
1
- import { __commonJS } from "../../../../../_virtual/rolldown_runtime.js";
2
-
3
- //#region ../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
4
- var require_has_flag = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js": ((exports, module) => {
5
- module.exports = (flag, argv = process.argv) => {
6
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
7
- const position = argv.indexOf(prefix + flag);
8
- const terminatorPosition = argv.indexOf("--");
9
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
10
- };
11
- }) });
12
-
13
- //#endregion
14
- export default require_has_flag();
15
-
16
- export { require_has_flag };