@japa/runner 4.1.0 → 4.2.0
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/build/index.js +12 -0
- package/package.json +10 -10
package/build/index.js
CHANGED
|
@@ -84,6 +84,7 @@ var ExceptionsManager = class {
|
|
|
84
84
|
*/
|
|
85
85
|
monitor() {
|
|
86
86
|
process.on("uncaughtException", async (error) => {
|
|
87
|
+
debug_default("received uncaught exception %O", error);
|
|
87
88
|
this.hasErrors = true;
|
|
88
89
|
if (this.#state === "watching") {
|
|
89
90
|
this.#exceptionsBuffer.push(error);
|
|
@@ -94,6 +95,7 @@ var ExceptionsManager = class {
|
|
|
94
95
|
}
|
|
95
96
|
});
|
|
96
97
|
process.on("unhandledRejection", async (error) => {
|
|
98
|
+
debug_default("received unhandled rejection %O", error);
|
|
97
99
|
this.hasErrors = true;
|
|
98
100
|
if (this.#state === "watching") {
|
|
99
101
|
this.#rejectionsBuffer.push(error);
|
|
@@ -219,6 +221,7 @@ async function run() {
|
|
|
219
221
|
globalHooks.apply(config);
|
|
220
222
|
await globalHooks.setup(runner);
|
|
221
223
|
for (let suite of suites) {
|
|
224
|
+
debug_default("initiating suite %s", suite.name);
|
|
222
225
|
executionPlanState.suite = new Suite(suite.name, emitter, config.refiner);
|
|
223
226
|
executionPlanState.retries = suite.retries;
|
|
224
227
|
executionPlanState.timeout = suite.timeout;
|
|
@@ -226,6 +229,7 @@ async function run() {
|
|
|
226
229
|
suite.configure(executionPlanState.suite);
|
|
227
230
|
}
|
|
228
231
|
if (cliArgs.bail && cliArgs.bailLayer === "suite") {
|
|
232
|
+
debug_default("enabling bail mode for the suite %s", suite.name);
|
|
229
233
|
executionPlanState.suite.bail(true);
|
|
230
234
|
}
|
|
231
235
|
runner.add(executionPlanState.suite);
|
|
@@ -245,18 +249,26 @@ async function run() {
|
|
|
245
249
|
await exceptionsManager.report();
|
|
246
250
|
const summary = runner.getSummary();
|
|
247
251
|
if (summary.hasError || exceptionsManager.hasErrors) {
|
|
252
|
+
debug_default(
|
|
253
|
+
"updating exit code to 1. summary.hasError %s, process.hasError",
|
|
254
|
+
summary.hasError,
|
|
255
|
+
exceptionsManager.hasErrors
|
|
256
|
+
);
|
|
248
257
|
process.exitCode = 1;
|
|
249
258
|
}
|
|
250
259
|
if (config.forceExit) {
|
|
260
|
+
debug_default("force exiting process");
|
|
251
261
|
process.exit();
|
|
252
262
|
}
|
|
253
263
|
} catch (error) {
|
|
264
|
+
debug_default("error running tests %O", error);
|
|
254
265
|
await globalHooks.teardown(error, runner);
|
|
255
266
|
const printer = new ErrorsPrinter2();
|
|
256
267
|
await printer.printError(error);
|
|
257
268
|
await exceptionsManager.report();
|
|
258
269
|
process.exitCode = 1;
|
|
259
270
|
if (runnerConfig.forceExit) {
|
|
271
|
+
debug_default("force exiting process");
|
|
260
272
|
process.exit();
|
|
261
273
|
}
|
|
262
274
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@japa/runner",
|
|
3
3
|
"description": "A simple yet powerful testing framework for Node.js",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.2.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.16.0"
|
|
7
7
|
},
|
|
@@ -39,28 +39,28 @@
|
|
|
39
39
|
"@adonisjs/prettier-config": "^1.4.0",
|
|
40
40
|
"@adonisjs/tsconfig": "^1.4.0",
|
|
41
41
|
"@release-it/conventional-changelog": "^10.0.0",
|
|
42
|
-
"@swc/core": "
|
|
42
|
+
"@swc/core": "1.10.7",
|
|
43
43
|
"@types/chai": "^5.0.1",
|
|
44
44
|
"@types/chai-subset": "^1.3.5",
|
|
45
45
|
"@types/find-cache-dir": "^5.0.2",
|
|
46
|
-
"@types/ms": "^
|
|
47
|
-
"@types/node": "^22.
|
|
46
|
+
"@types/ms": "^2.1.0",
|
|
47
|
+
"@types/node": "^22.12.0",
|
|
48
48
|
"c8": "^10.1.3",
|
|
49
49
|
"chai": "^5.1.2",
|
|
50
50
|
"chai-subset": "^1.6.0",
|
|
51
51
|
"cross-env": "^7.0.3",
|
|
52
52
|
"del-cli": "^6.0.0",
|
|
53
|
-
"eslint": "^9.
|
|
54
|
-
"glob": "^11.0.
|
|
53
|
+
"eslint": "^9.19.0",
|
|
54
|
+
"glob": "^11.0.1",
|
|
55
55
|
"prettier": "^3.4.2",
|
|
56
|
-
"release-it": "^18.1.
|
|
57
|
-
"ts-node-maintained": "^10.9.
|
|
58
|
-
"tsup": "^8.3.
|
|
56
|
+
"release-it": "^18.1.2",
|
|
57
|
+
"ts-node-maintained": "^10.9.5",
|
|
58
|
+
"tsup": "^8.3.6",
|
|
59
59
|
"typescript": "^5.7.3"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@japa/core": "^10.3.0",
|
|
63
|
-
"@japa/errors-printer": "^4.1.
|
|
63
|
+
"@japa/errors-printer": "^4.1.2",
|
|
64
64
|
"@poppinss/colors": "^4.1.4",
|
|
65
65
|
"@poppinss/hooks": "^7.2.5",
|
|
66
66
|
"fast-glob": "^3.3.3",
|