@japa/runner 3.0.1 → 3.0.2
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/src/plugins/retry.js +16 -8
- package/package.json +6 -6
|
@@ -51,16 +51,24 @@ export const retryPlugin = async function retry({ config, cliArgs }) {
|
|
|
51
51
|
if (!SUMMARY_FILE) {
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
config.
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
config.setup.push((runner) => {
|
|
55
|
+
return async () => {
|
|
56
|
+
const summary = runner.getSummary();
|
|
57
|
+
await cacheFailedTests(summary.failedTestsTitles);
|
|
58
|
+
};
|
|
57
59
|
});
|
|
58
60
|
if (cliArgs.failed) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
try {
|
|
62
|
+
const { tests } = await getFailedTests();
|
|
63
|
+
if (!tests || !tests.length) {
|
|
64
|
+
console.log(colors.bgYellow().black(' No failing tests found. Running all the tests '));
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
config.filters.tests = tests;
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
console.log(colors.bgRed().black(' Unable to read failed tests. Running all the tests '));
|
|
71
|
+
console.log(colors.red(error));
|
|
63
72
|
}
|
|
64
|
-
config.filters.tests = tests;
|
|
65
73
|
}
|
|
66
74
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@japa/runner",
|
|
3
3
|
"description": "Runner for Japa testing framework",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.2",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.16.0"
|
|
7
7
|
},
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"@commitlint/cli": "^17.7.2",
|
|
44
44
|
"@commitlint/config-conventional": "^17.7.0",
|
|
45
45
|
"@swc/core": "1.3.82",
|
|
46
|
-
"@types/chai": "^4.3.
|
|
46
|
+
"@types/chai": "^4.3.8",
|
|
47
47
|
"@types/chai-subset": "^1.3.3",
|
|
48
48
|
"@types/find-cache-dir": "^5.0.0",
|
|
49
49
|
"@types/ms": "^0.7.32",
|
|
50
|
-
"@types/node": "^20.8.
|
|
50
|
+
"@types/node": "^20.8.6",
|
|
51
51
|
"c8": "^8.0.1",
|
|
52
52
|
"chai": "^4.3.10",
|
|
53
53
|
"chai-subset": "^1.6.0",
|
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
"typescript": "^5.2.2"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@japa/core": "^8.0.
|
|
66
|
+
"@japa/core": "^8.0.2",
|
|
67
67
|
"@japa/errors-printer": "^3.0.0",
|
|
68
|
-
"@poppinss/colors": "^4.1.0
|
|
69
|
-
"@poppinss/hooks": "^7.
|
|
68
|
+
"@poppinss/colors": "^4.1.0",
|
|
69
|
+
"@poppinss/hooks": "^7.2.0",
|
|
70
70
|
"fast-glob": "^3.3.1",
|
|
71
71
|
"find-cache-dir": "^5.0.0",
|
|
72
72
|
"getopts": "^2.3.0",
|