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

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 (102) 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/context.js +1 -3
  7. package/package.json +8 -11
  8. package/dist/node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js +0 -142
  9. package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js +0 -157
  10. package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js +0 -97
  11. package/dist/node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js +0 -40
  12. package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js +0 -814
  13. package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js +0 -50
  14. package/dist/node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js +0 -68
  15. package/dist/node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js +0 -752
  16. package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/browser.js +0 -203
  17. package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/common.js +0 -209
  18. package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/index.js +0 -18
  19. package/dist/node_modules/.pnpm/debug@4.4.3_supports-color@8.1.1/node_modules/debug/src/node.js +0 -215
  20. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/convert/dmp.js +0 -24
  21. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/convert/xml.js +0 -33
  22. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/array.js +0 -29
  23. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/base.js +0 -185
  24. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/character.js +0 -23
  25. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/css.js +0 -26
  26. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/json.js +0 -83
  27. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/line.js +0 -51
  28. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/sentence.js +0 -26
  29. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/diff/word.js +0 -151
  30. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/index.js +0 -178
  31. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/apply.js +0 -168
  32. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/create.js +0 -301
  33. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/line-endings.js +0 -137
  34. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/merge.js +0 -367
  35. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/parse.js +0 -91
  36. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/patch/reverse.js +0 -99
  37. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/array.js +0 -23
  38. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/distance-iterator.js +0 -30
  39. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/params.js +0 -22
  40. package/dist/node_modules/.pnpm/diff@7.0.0/node_modules/diff/lib/util/string.js +0 -97
  41. package/dist/node_modules/.pnpm/escape-string-regexp@4.0.0/node_modules/escape-string-regexp/index.js +0 -14
  42. package/dist/node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js +0 -16
  43. package/dist/node_modules/.pnpm/he@1.2.0/node_modules/he/he.js +0 -4093
  44. package/dist/node_modules/.pnpm/is-unicode-supported@0.1.0/node_modules/is-unicode-supported/index.js +0 -14
  45. package/dist/node_modules/.pnpm/log-symbols@4.1.0/node_modules/log-symbols/index.js +0 -27
  46. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/index.js +0 -12
  47. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/context.js +0 -83
  48. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/error-constants.js +0 -35
  49. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/errors.js +0 -392
  50. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/hook.js +0 -86
  51. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/bdd.js +0 -104
  52. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/common.js +0 -99
  53. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/exports.js +0 -65
  54. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/index.js +0 -18
  55. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/qunit.js +0 -95
  56. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/tdd.js +0 -105
  57. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/mocha.js +0 -1037
  58. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/mocharc.js +0 -24
  59. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/buffered-worker-pool.js +0 -152
  60. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/esm-utils.js +0 -74
  61. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/file-unloader.js +0 -22
  62. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/parallel-buffered-runner.js +0 -329
  63. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/nodejs/serializer.js +0 -314
  64. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/pending.js +0 -22
  65. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/base.js +0 -417
  66. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/doc.js +0 -79
  67. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/dot.js +0 -75
  68. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/html.js +0 -283
  69. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/index.js +0 -40
  70. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/json-stream.js +0 -90
  71. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/json.js +0 -145
  72. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/landing.js +0 -107
  73. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/list.js +0 -77
  74. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/markdown.js +0 -106
  75. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/min.js +0 -57
  76. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/nyan.js +0 -233
  77. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/progress.js +0 -92
  78. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/spec.js +0 -91
  79. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/tap.js +0 -261
  80. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/reporters/xunit.js +0 -166
  81. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/runnable.js +0 -346
  82. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/runner.js +0 -922
  83. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/stats-collector.js +0 -72
  84. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/suite.js +0 -517
  85. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/test.js +0 -105
  86. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/utils.js +0 -505
  87. package/dist/node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/package.js +0 -225
  88. package/dist/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js +0 -124
  89. package/dist/node_modules/.pnpm/randombytes@2.1.0/node_modules/randombytes/index.js +0 -11
  90. package/dist/node_modules/.pnpm/serialize-javascript@6.0.2/node_modules/serialize-javascript/index.js +0 -114
  91. package/dist/node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js +0 -76
  92. package/dist/node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js +0 -89
  93. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/Pool.js +0 -366
  94. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/Promise.js +0 -248
  95. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/WorkerHandler.js +0 -419
  96. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/debug-port-allocator.js +0 -27
  97. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/environment.js +0 -18
  98. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/generated/embeddedWorker.js +0 -16
  99. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/index.js +0 -63
  100. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/transfer.js +0 -21
  101. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/validateOptions.js +0 -9
  102. package/dist/node_modules/.pnpm/workerpool@9.3.4/node_modules/workerpool/src/worker.js +0 -277
@@ -1,104 +0,0 @@
1
- import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
2
- import { require_suite } from "../suite.js";
3
- import { require_test } from "../test.js";
4
- import { require_common } from "./common.js";
5
-
6
- //#region ../../node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/bdd.js
7
- var require_bdd = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/bdd.js": ((exports, module) => {
8
- /**
9
- * @typedef {import('../suite.js')} Suite
10
- */
11
- var Test = require_test();
12
- var EVENT_FILE_PRE_REQUIRE = require_suite().constants.EVENT_FILE_PRE_REQUIRE;
13
- /**
14
- * BDD-style interface:
15
- *
16
- * describe('Array', function() {
17
- * describe('#indexOf()', function() {
18
- * it('should return -1 when not present', function() {
19
- * // ...
20
- * });
21
- *
22
- * it('should return the index when present', function() {
23
- * // ...
24
- * });
25
- * });
26
- * });
27
- *
28
- * @param {Suite} suite Root suite.
29
- */
30
- module.exports = function bddInterface(suite) {
31
- var suites = [suite];
32
- suite.on(EVENT_FILE_PRE_REQUIRE, function(context, file, mocha) {
33
- var common = require_common()(suites, context, mocha);
34
- context.before = common.before;
35
- context.after = common.after;
36
- context.beforeEach = common.beforeEach;
37
- context.afterEach = common.afterEach;
38
- context.run = mocha.options.delay && common.runWithSuite(suite);
39
- /**
40
- * Describe a "suite" with the given `title`
41
- * and callback `fn` containing nested suites
42
- * and/or tests.
43
- */
44
- context.describe = context.context = function(title, fn) {
45
- return common.suite.create({
46
- title,
47
- file,
48
- fn
49
- });
50
- };
51
- /**
52
- * Pending describe.
53
- */
54
- context.xdescribe = context.xcontext = context.describe.skip = function(title, fn) {
55
- return common.suite.skip({
56
- title,
57
- file,
58
- fn
59
- });
60
- };
61
- /**
62
- * Exclusive suite.
63
- */
64
- context.describe.only = function(title, fn) {
65
- return common.suite.only({
66
- title,
67
- file,
68
- fn
69
- });
70
- };
71
- /**
72
- * Describe a specification or test-case
73
- * with the given `title` and callback `fn`
74
- * acting as a thunk.
75
- */
76
- context.it = context.specify = function(title, fn) {
77
- var suite$1 = suites[0];
78
- if (suite$1.isPending()) fn = null;
79
- var test = new Test(title, fn);
80
- test.file = file;
81
- suite$1.addTest(test);
82
- return test;
83
- };
84
- /**
85
- * Exclusive test-case.
86
- */
87
- context.it.only = function(title, fn) {
88
- return common.test.only(mocha, context.it(title, fn));
89
- };
90
- /**
91
- * Pending test case.
92
- */
93
- context.xit = context.xspecify = context.it.skip = function(title) {
94
- return context.it(title);
95
- };
96
- });
97
- };
98
- module.exports.description = "BDD or RSpec style [default]";
99
- }) });
100
-
101
- //#endregion
102
- export default require_bdd();
103
-
104
- export { require_bdd };
@@ -1,99 +0,0 @@
1
- import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
2
- import { require_errors } from "../errors.js";
3
- import { require_suite } from "../suite.js";
4
-
5
- //#region ../../node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/common.js
6
- var require_common = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/common.js": ((exports, module) => {
7
- /**
8
- * @typedef {import('../context.js')} Context
9
- * @typedef {import('../mocha.js')} Mocha
10
- */
11
- /**
12
- @module interfaces/common
13
- */
14
- var Suite = require_suite();
15
- var errors = require_errors();
16
- var createMissingArgumentError = errors.createMissingArgumentError;
17
- var createUnsupportedError = errors.createUnsupportedError;
18
- var createForbiddenExclusivityError = errors.createForbiddenExclusivityError;
19
- /**
20
- * Functions common to more than one interface.
21
- *
22
- * @private
23
- * @param {Suite[]} suites
24
- * @param {Context} context
25
- * @param {Mocha} mocha
26
- * @return {Object} An object containing common functions.
27
- */
28
- module.exports = function(suites, context, mocha) {
29
- /**
30
- * Check if the suite should be tested.
31
- *
32
- * @private
33
- * @param {Suite} suite - suite to check
34
- * @returns {boolean}
35
- */
36
- function shouldBeTested(suite) {
37
- return !mocha.options.grep || mocha.options.grep && mocha.options.grep.test(suite.fullTitle()) && !mocha.options.invert;
38
- }
39
- return {
40
- runWithSuite: function runWithSuite(suite) {
41
- return function run() {
42
- suite.run();
43
- };
44
- },
45
- before: function(name, fn) {
46
- return suites[0].beforeAll(name, fn);
47
- },
48
- after: function(name, fn) {
49
- return suites[0].afterAll(name, fn);
50
- },
51
- beforeEach: function(name, fn) {
52
- return suites[0].beforeEach(name, fn);
53
- },
54
- afterEach: function(name, fn) {
55
- return suites[0].afterEach(name, fn);
56
- },
57
- suite: {
58
- only: function only(opts) {
59
- if (mocha.options.forbidOnly) throw createForbiddenExclusivityError(mocha);
60
- opts.isOnly = true;
61
- return this.create(opts);
62
- },
63
- skip: function skip(opts) {
64
- opts.pending = true;
65
- return this.create(opts);
66
- },
67
- create: function create(opts) {
68
- var suite = Suite.create(suites[0], opts.title);
69
- suite.pending = Boolean(opts.pending);
70
- suite.file = opts.file;
71
- suites.unshift(suite);
72
- if (opts.isOnly) suite.markOnly();
73
- if (suite.pending && mocha.options.forbidPending && shouldBeTested(suite)) throw createUnsupportedError("Pending test forbidden");
74
- if (typeof opts.fn === "function") {
75
- opts.fn.call(suite);
76
- suites.shift();
77
- } else if (typeof opts.fn === "undefined" && !suite.pending) throw createMissingArgumentError("Suite \"" + suite.fullTitle() + "\" was defined but no callback was supplied. Supply a callback or explicitly skip the suite.", "callback", "function");
78
- else if (!opts.fn && suite.pending) suites.shift();
79
- return suite;
80
- }
81
- },
82
- test: {
83
- only: function(mocha$1, test) {
84
- if (mocha$1.options.forbidOnly) throw createForbiddenExclusivityError(mocha$1);
85
- test.markOnly();
86
- return test;
87
- },
88
- skip: function(title) {
89
- context.test(title);
90
- }
91
- }
92
- };
93
- };
94
- }) });
95
-
96
- //#endregion
97
- export default require_common();
98
-
99
- export { require_common };
@@ -1,65 +0,0 @@
1
- import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
2
- import { require_suite } from "../suite.js";
3
- import { require_test } from "../test.js";
4
-
5
- //#region ../../node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/exports.js
6
- var require_exports = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/exports.js": ((exports, module) => {
7
- var Suite = require_suite();
8
- var Test = require_test();
9
- /**
10
- * Exports-style (as Node.js module) interface:
11
- *
12
- * exports.Array = {
13
- * '#indexOf()': {
14
- * 'should return -1 when the value is not present': function() {
15
- *
16
- * },
17
- *
18
- * 'should return the correct index when the value is present': function() {
19
- *
20
- * }
21
- * }
22
- * };
23
- *
24
- * @param {Suite} suite Root suite.
25
- */
26
- module.exports = function(suite) {
27
- var suites = [suite];
28
- suite.on(Suite.constants.EVENT_FILE_REQUIRE, visit);
29
- function visit(obj, file) {
30
- var suite$1;
31
- for (var key in obj) if (typeof obj[key] === "function") {
32
- var fn = obj[key];
33
- switch (key) {
34
- case "before":
35
- suites[0].beforeAll(fn);
36
- break;
37
- case "after":
38
- suites[0].afterAll(fn);
39
- break;
40
- case "beforeEach":
41
- suites[0].beforeEach(fn);
42
- break;
43
- case "afterEach":
44
- suites[0].afterEach(fn);
45
- break;
46
- default:
47
- var test = new Test(key, fn);
48
- test.file = file;
49
- suites[0].addTest(test);
50
- }
51
- } else {
52
- suite$1 = Suite.create(suites[0], key);
53
- suites.unshift(suite$1);
54
- visit(obj[key], file);
55
- suites.shift();
56
- }
57
- }
58
- };
59
- module.exports.description = "Node.js module (\"exports\") style";
60
- }) });
61
-
62
- //#endregion
63
- export default require_exports();
64
-
65
- export { require_exports };
@@ -1,18 +0,0 @@
1
- import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
2
- import { require_bdd } from "./bdd.js";
3
- import { require_tdd } from "./tdd.js";
4
- import { require_qunit } from "./qunit.js";
5
- import { require_exports } from "./exports.js";
6
-
7
- //#region ../../node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/index.js
8
- var require_interfaces = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/index.js": ((exports) => {
9
- exports.bdd = require_bdd();
10
- exports.tdd = require_tdd();
11
- exports.qunit = require_qunit();
12
- exports.exports = require_exports();
13
- }) });
14
-
15
- //#endregion
16
- export default require_interfaces();
17
-
18
- export { require_interfaces };
@@ -1,95 +0,0 @@
1
- import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
2
- import { require_suite } from "../suite.js";
3
- import { require_test } from "../test.js";
4
- import { require_common } from "./common.js";
5
-
6
- //#region ../../node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/qunit.js
7
- var require_qunit = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/qunit.js": ((exports, module) => {
8
- /**
9
- * @typedef {import('../suite.js')} Suite
10
- */
11
- var Test = require_test();
12
- var EVENT_FILE_PRE_REQUIRE = require_suite().constants.EVENT_FILE_PRE_REQUIRE;
13
- /**
14
- * QUnit-style interface:
15
- *
16
- * suite('Array');
17
- *
18
- * test('#length', function() {
19
- * var arr = [1,2,3];
20
- * ok(arr.length == 3);
21
- * });
22
- *
23
- * test('#indexOf()', function() {
24
- * var arr = [1,2,3];
25
- * ok(arr.indexOf(1) == 0);
26
- * ok(arr.indexOf(2) == 1);
27
- * ok(arr.indexOf(3) == 2);
28
- * });
29
- *
30
- * suite('String');
31
- *
32
- * test('#length', function() {
33
- * ok('foo'.length == 3);
34
- * });
35
- *
36
- * @param {Suite} suite Root suite.
37
- */
38
- module.exports = function qUnitInterface(suite) {
39
- var suites = [suite];
40
- suite.on(EVENT_FILE_PRE_REQUIRE, function(context, file, mocha) {
41
- var common = require_common()(suites, context, mocha);
42
- context.before = common.before;
43
- context.after = common.after;
44
- context.beforeEach = common.beforeEach;
45
- context.afterEach = common.afterEach;
46
- context.run = mocha.options.delay && common.runWithSuite(suite);
47
- /**
48
- * Describe a "suite" with the given `title`.
49
- */
50
- context.suite = function(title) {
51
- if (suites.length > 1) suites.shift();
52
- return common.suite.create({
53
- title,
54
- file,
55
- fn: false
56
- });
57
- };
58
- /**
59
- * Exclusive Suite.
60
- */
61
- context.suite.only = function(title) {
62
- if (suites.length > 1) suites.shift();
63
- return common.suite.only({
64
- title,
65
- file,
66
- fn: false
67
- });
68
- };
69
- /**
70
- * Describe a specification or test-case
71
- * with the given `title` and callback `fn`
72
- * acting as a thunk.
73
- */
74
- context.test = function(title, fn) {
75
- var test = new Test(title, fn);
76
- test.file = file;
77
- suites[0].addTest(test);
78
- return test;
79
- };
80
- /**
81
- * Exclusive test-case.
82
- */
83
- context.test.only = function(title, fn) {
84
- return common.test.only(mocha, context.test(title, fn));
85
- };
86
- context.test.skip = common.test.skip;
87
- });
88
- };
89
- module.exports.description = "QUnit style";
90
- }) });
91
-
92
- //#endregion
93
- export default require_qunit();
94
-
95
- export { require_qunit };
@@ -1,105 +0,0 @@
1
- import { __commonJS } from "../../../../../../../_virtual/rolldown_runtime.js";
2
- import { require_suite } from "../suite.js";
3
- import { require_test } from "../test.js";
4
- import { require_common } from "./common.js";
5
-
6
- //#region ../../node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/tdd.js
7
- var require_tdd = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/mocha@11.7.2/node_modules/mocha/lib/interfaces/tdd.js": ((exports, module) => {
8
- /**
9
- * @typedef {import('../suite.js')} Suite
10
- */
11
- var Test = require_test();
12
- var EVENT_FILE_PRE_REQUIRE = require_suite().constants.EVENT_FILE_PRE_REQUIRE;
13
- /**
14
- * TDD-style interface:
15
- *
16
- * suite('Array', function() {
17
- * suite('#indexOf()', function() {
18
- * suiteSetup(function() {
19
- *
20
- * });
21
- *
22
- * test('should return -1 when not present', function() {
23
- *
24
- * });
25
- *
26
- * test('should return the index when present', function() {
27
- *
28
- * });
29
- *
30
- * suiteTeardown(function() {
31
- *
32
- * });
33
- * });
34
- * });
35
- *
36
- * @param {Suite} suite Root suite.
37
- */
38
- module.exports = function(suite) {
39
- var suites = [suite];
40
- suite.on(EVENT_FILE_PRE_REQUIRE, function(context, file, mocha) {
41
- var common = require_common()(suites, context, mocha);
42
- context.setup = common.beforeEach;
43
- context.teardown = common.afterEach;
44
- context.suiteSetup = common.before;
45
- context.suiteTeardown = common.after;
46
- context.run = mocha.options.delay && common.runWithSuite(suite);
47
- /**
48
- * Describe a "suite" with the given `title` and callback `fn` containing
49
- * nested suites and/or tests.
50
- */
51
- context.suite = function(title, fn) {
52
- return common.suite.create({
53
- title,
54
- file,
55
- fn
56
- });
57
- };
58
- /**
59
- * Pending suite.
60
- */
61
- context.suite.skip = function(title, fn) {
62
- return common.suite.skip({
63
- title,
64
- file,
65
- fn
66
- });
67
- };
68
- /**
69
- * Exclusive test-case.
70
- */
71
- context.suite.only = function(title, fn) {
72
- return common.suite.only({
73
- title,
74
- file,
75
- fn
76
- });
77
- };
78
- /**
79
- * Describe a specification or test-case with the given `title` and
80
- * callback `fn` acting as a thunk.
81
- */
82
- context.test = function(title, fn) {
83
- var suite$1 = suites[0];
84
- if (suite$1.isPending()) fn = null;
85
- var test = new Test(title, fn);
86
- test.file = file;
87
- suite$1.addTest(test);
88
- return test;
89
- };
90
- /**
91
- * Exclusive test-case.
92
- */
93
- context.test.only = function(title, fn) {
94
- return common.test.only(mocha, context.test(title, fn));
95
- };
96
- context.test.skip = common.test.skip;
97
- });
98
- };
99
- module.exports.description = "traditional \"suite\"/\"test\" instead of BDD's \"describe\"/\"it\"";
100
- }) });
101
-
102
- //#endregion
103
- export default require_tdd();
104
-
105
- export { require_tdd };