mocha 12.0.0-beta-1 → 12.0.0-beta-3
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.
- package/README.md +1 -1
- package/browser-entry.js +0 -1
- package/lib/cli/config.js +1 -1
- package/lib/cli/lookup-files.js +2 -2
- package/lib/errors.js +1 -1
- package/lib/mocha.js +9 -1
- package/lib/nodejs/esm-utils.js +3 -0
- package/lib/nodejs/worker.js +1 -2
- package/lib/reporters/base.js +1 -1
- package/lib/reporters/html.js +0 -1
- package/lib/runner.js +2 -2
- package/lib/utils.js +4 -4
- package/mocha.js +20182 -21635
- package/mocha.js.map +1 -1
- package/mocha.mjs +68 -0
- package/package.json +21 -23
package/mocha.mjs
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// this built file is not committed to the repo
|
|
2
|
+
/* eslint-disable-next-line n/no-missing-import */
|
|
3
|
+
import "./mocha.js";
|
|
4
|
+
|
|
5
|
+
const {mocha, Mocha} = globalThis;
|
|
6
|
+
|
|
7
|
+
const mochaExports = {
|
|
8
|
+
after: (...args) => globalThis.after?.(...args),
|
|
9
|
+
afterEach: (...args) => globalThis.afterEach?.(...args),
|
|
10
|
+
before: (...args) => globalThis.before?.(...args),
|
|
11
|
+
beforeEach: (...args) => globalThis.beforeEach?.(...args),
|
|
12
|
+
context: (...args) => globalThis.context?.(...args),
|
|
13
|
+
describe: (...args) => globalThis.describe?.(...args),
|
|
14
|
+
it: (...args) => globalThis.it?.(...args),
|
|
15
|
+
run: mocha.run.bind(mocha),
|
|
16
|
+
setup: (...args) => mocha.setup?.(...args),
|
|
17
|
+
suite: (...args) => globalThis.suite?.(...args),
|
|
18
|
+
suiteSetup: (...args) => globalThis.suiteSetup?.(...args),
|
|
19
|
+
suiteTeardown: (...args) => globalThis.suiteTeardown?.(...args),
|
|
20
|
+
teardown: (...args) => globalThis.teardown?.(...args),
|
|
21
|
+
test: (...args) => globalThis.test?.(...args),
|
|
22
|
+
specify: (...args) => globalThis.specify?.(...args),
|
|
23
|
+
xcontext: (...args) => globalThis.xcontext?.(...args),
|
|
24
|
+
xdescribe: (...args) => globalThis.xdescribe?.(...args),
|
|
25
|
+
xit: (...args) => globalThis.xit?.(...args),
|
|
26
|
+
xspecify: (...args) => globalThis.xspecify?.(...args),
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default Mocha;
|
|
30
|
+
|
|
31
|
+
// Export the mocha instance (in browser, this has setup/run methods)
|
|
32
|
+
export { mocha };
|
|
33
|
+
|
|
34
|
+
// Re-export class/utility exports from the Mocha module
|
|
35
|
+
export const {
|
|
36
|
+
utils,
|
|
37
|
+
interfaces,
|
|
38
|
+
reporters,
|
|
39
|
+
Runnable,
|
|
40
|
+
Context,
|
|
41
|
+
Runner,
|
|
42
|
+
Suite,
|
|
43
|
+
Hook,
|
|
44
|
+
Test,
|
|
45
|
+
} = Mocha;
|
|
46
|
+
|
|
47
|
+
// Re-export test interface functions
|
|
48
|
+
export const {
|
|
49
|
+
after,
|
|
50
|
+
afterEach,
|
|
51
|
+
before,
|
|
52
|
+
beforeEach,
|
|
53
|
+
context,
|
|
54
|
+
describe,
|
|
55
|
+
it,
|
|
56
|
+
run,
|
|
57
|
+
setup,
|
|
58
|
+
suite,
|
|
59
|
+
suiteSetup,
|
|
60
|
+
suiteTeardown,
|
|
61
|
+
teardown,
|
|
62
|
+
test,
|
|
63
|
+
specify,
|
|
64
|
+
xcontext,
|
|
65
|
+
xdescribe,
|
|
66
|
+
xit,
|
|
67
|
+
xspecify,
|
|
68
|
+
} = mochaExports;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mocha",
|
|
3
|
-
"version": "12.0.0-beta-
|
|
3
|
+
"version": "12.0.0-beta-3",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "simple, flexible, fun test framework",
|
|
6
6
|
"keywords": [
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"node": "^20.19.0 || >=22.12.0"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
|
-
"build": "rollup -c ./rollup.config.
|
|
46
|
+
"build": "rollup -c ./rollup.config.mjs",
|
|
47
47
|
"clean": "rimraf mocha.js mocha.js.map",
|
|
48
48
|
"docs-clean": "rimraf docs/_site docs/api",
|
|
49
49
|
"docs-watch": "eleventy --serve",
|
|
@@ -52,12 +52,10 @@
|
|
|
52
52
|
"docs:build-new": "cd docs-next && npm i && npm run build-with-old",
|
|
53
53
|
"docs:preview": "http-server docs/_site -o",
|
|
54
54
|
"docs": "run-s docs-clean docs:api docs:build docs:build-new",
|
|
55
|
-
"format
|
|
56
|
-
"format:prettier": "prettier --write .",
|
|
57
|
-
"format": "run-s format:*",
|
|
55
|
+
"format": "prettier --write .",
|
|
58
56
|
"lint:installed-check": "installed-check --engine-check",
|
|
59
57
|
"lint:knip": "knip --cache",
|
|
60
|
-
"lint:code": "eslint .
|
|
58
|
+
"lint:code": "eslint . --max-warnings 0",
|
|
61
59
|
"lint:markdown": "markdownlint \"*.md\" \"docs/**/*.md\" \".github/*.md\" \"lib/**/*.md\" \"test/**/*.md\" \"example/**/*.md\" -i CHANGELOG.md",
|
|
62
60
|
"lint": "run-p lint:*",
|
|
63
61
|
"prepublishOnly": "run-s clean build version",
|
|
@@ -104,7 +102,7 @@
|
|
|
104
102
|
"diff": "^7.0.0",
|
|
105
103
|
"escape-string-regexp": "^4.0.0",
|
|
106
104
|
"find-up": "^5.0.0",
|
|
107
|
-
"glob": "^
|
|
105
|
+
"glob": "^13.0.0",
|
|
108
106
|
"he": "^1.2.0",
|
|
109
107
|
"is-path-inside": "^3.0.3",
|
|
110
108
|
"js-yaml": "^4.1.0",
|
|
@@ -112,8 +110,8 @@
|
|
|
112
110
|
"minimatch": "^9.0.5",
|
|
113
111
|
"ms": "^2.1.3",
|
|
114
112
|
"picocolors": "^1.1.1",
|
|
115
|
-
"serialize-javascript": "^
|
|
116
|
-
"strip-json-comments": "^
|
|
113
|
+
"serialize-javascript": "^7.0.2",
|
|
114
|
+
"strip-json-comments": "^5.0.3",
|
|
117
115
|
"supports-color": "^8.1.1",
|
|
118
116
|
"workerpool": "^9.2.0",
|
|
119
117
|
"yargs": "^17.7.2",
|
|
@@ -123,23 +121,23 @@
|
|
|
123
121
|
"devDependencies": {
|
|
124
122
|
"@11ty/eleventy": "^1.0.0",
|
|
125
123
|
"@11ty/eleventy-plugin-inclusive-language": "^1.0.3",
|
|
126
|
-
"@eslint/js": "^
|
|
124
|
+
"@eslint/js": "^9.39.2",
|
|
127
125
|
"@mocha/docdash": "^4.0.1",
|
|
128
126
|
"@rollup/plugin-alias": "^5.1.1",
|
|
129
|
-
"@rollup/plugin-commonjs": "^
|
|
130
|
-
"@rollup/plugin-json": "^
|
|
131
|
-
"@rollup/plugin-multi-entry": "^
|
|
132
|
-
"@rollup/plugin-node-resolve": "^
|
|
127
|
+
"@rollup/plugin-commonjs": "^28.0.8",
|
|
128
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
129
|
+
"@rollup/plugin-multi-entry": "^7.1.0",
|
|
130
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
133
131
|
"@test/esm-only-loader": "./test/compiler-fixtures/esm-only-loader",
|
|
134
132
|
"@types/node": "^22.15.3",
|
|
135
133
|
"@types/yargs": "^17.0.33",
|
|
136
134
|
"chai": "^4.3.4",
|
|
137
135
|
"coffeescript": "^2.6.1",
|
|
138
136
|
"cross-env": "^7.0.2",
|
|
139
|
-
"eslint": "^
|
|
140
|
-
"eslint-plugin-n": "^17.
|
|
137
|
+
"eslint": "^9.39.2",
|
|
138
|
+
"eslint-plugin-n": "^17.23.1",
|
|
141
139
|
"fail-on-errors-webpack-plugin": "^3.0.0",
|
|
142
|
-
"globals": "^
|
|
140
|
+
"globals": "^16.5.0",
|
|
143
141
|
"http-server": "^14.1.1",
|
|
144
142
|
"installed-check": "^9.3.0",
|
|
145
143
|
"jsdoc": "^3.6.7",
|
|
@@ -156,10 +154,10 @@
|
|
|
156
154
|
"markdown-it-emoji": "^2.0.0",
|
|
157
155
|
"markdown-it-prism": "^2.2.2",
|
|
158
156
|
"markdown-toc": "^1.2.0",
|
|
159
|
-
"markdownlint-cli": "^0.
|
|
157
|
+
"markdownlint-cli": "^0.46.0",
|
|
160
158
|
"needle": "^2.5.0",
|
|
161
159
|
"npm-run-all2": "^6.2.0",
|
|
162
|
-
"nyc": "^
|
|
160
|
+
"nyc": "^17.1.0",
|
|
163
161
|
"prettier": "3.6.2",
|
|
164
162
|
"ps-list": "^9.0.0",
|
|
165
163
|
"remark": "^14.0.2",
|
|
@@ -167,10 +165,9 @@
|
|
|
167
165
|
"remark-inline-links": "^6.0.1",
|
|
168
166
|
"rewiremock": "^3.14.3",
|
|
169
167
|
"rimraf": "^3.0.2",
|
|
170
|
-
"rollup": "^
|
|
171
|
-
"rollup-plugin-node
|
|
172
|
-
"rollup-plugin-
|
|
173
|
-
"rollup-plugin-visualizer": "^5.6.0",
|
|
168
|
+
"rollup": "^4.52.3",
|
|
169
|
+
"rollup-plugin-polyfill-node": "^0.13.0",
|
|
170
|
+
"rollup-plugin-visualizer": "^6.0.5",
|
|
174
171
|
"semver": "^7.7.2",
|
|
175
172
|
"sinon": "^9.0.3",
|
|
176
173
|
"typescript": "^5.8.3",
|
|
@@ -190,6 +187,7 @@
|
|
|
190
187
|
"mocha.css",
|
|
191
188
|
"mocha.js",
|
|
192
189
|
"mocha.js.map",
|
|
190
|
+
"mocha.mjs",
|
|
193
191
|
"browser-entry.js"
|
|
194
192
|
],
|
|
195
193
|
"browser": {
|