@lvce-editor/test-with-playwright 7.2.0 → 7.4.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/dist/main.js +16 -10
- package/package.json +3 -3
package/dist/main.js
CHANGED
|
@@ -4,33 +4,39 @@ import { pathToFileURL, fileURLToPath } from 'node:url';
|
|
|
4
4
|
const HandleResult = 'HandleResult';
|
|
5
5
|
const HandleFinalResult = 'HandleFinalResult';
|
|
6
6
|
|
|
7
|
+
const formatDuration = duration => {
|
|
8
|
+
const roundedDuration = Math.round(duration);
|
|
9
|
+
return `${roundedDuration}ms`;
|
|
10
|
+
};
|
|
11
|
+
|
|
7
12
|
const getFinalResultMessage = (passed, skipped, failed, duration) => {
|
|
8
13
|
if (passed === 0 && skipped === 0 && failed === 0) {
|
|
9
14
|
return `no tests found`;
|
|
10
15
|
}
|
|
16
|
+
const formattedDuration = formatDuration(duration);
|
|
11
17
|
if (passed === 0 && skipped === 0 && failed === 1) {
|
|
12
|
-
return `${failed} test failed in ${
|
|
18
|
+
return `${failed} test failed in ${formattedDuration}`;
|
|
13
19
|
}
|
|
14
20
|
if (passed === 0 && skipped === 1 && failed === 0) {
|
|
15
|
-
return `${skipped} test skipped in ${
|
|
21
|
+
return `${skipped} test skipped in ${formattedDuration}`;
|
|
16
22
|
}
|
|
17
23
|
if (passed === 0 && skipped === 1 && failed === 1) {
|
|
18
|
-
return `${skipped} test skipped, ${failed} test failed in ${
|
|
24
|
+
return `${skipped} test skipped, ${failed} test failed in ${formattedDuration}`;
|
|
19
25
|
}
|
|
20
26
|
if (passed === 1 && skipped === 0 && failed === 0) {
|
|
21
|
-
return `${passed} test passed in ${
|
|
27
|
+
return `${passed} test passed in ${formattedDuration}`;
|
|
22
28
|
}
|
|
23
29
|
if (passed === 1 && skipped === 0 && failed === 1) {
|
|
24
|
-
return `${passed} test passed, ${failed} test failed in ${
|
|
30
|
+
return `${passed} test passed, ${failed} test failed in ${formattedDuration}`;
|
|
25
31
|
}
|
|
26
32
|
if (passed === 1 && skipped === 1 && failed === 0) {
|
|
27
|
-
return `${passed} test passed, ${skipped} test skipped in ${
|
|
33
|
+
return `${passed} test passed, ${skipped} test skipped in ${formattedDuration}`;
|
|
28
34
|
}
|
|
29
35
|
if (passed === 1 && skipped === 1 && failed === 1) {
|
|
30
|
-
return `${passed} test passed, ${skipped} test skipped, ${failed} test failed in ${
|
|
36
|
+
return `${passed} test passed, ${skipped} test skipped, ${failed} test failed in ${formattedDuration}`;
|
|
31
37
|
}
|
|
32
38
|
if (passed > 1 && skipped === 0 && failed === 0) {
|
|
33
|
-
return `${passed} tests passed in ${
|
|
39
|
+
return `${passed} tests passed in ${formattedDuration}`;
|
|
34
40
|
}
|
|
35
41
|
return `${passed} tests passed, ${skipped} tests skipped, ${failed} tests failed in ${duration}ms`;
|
|
36
42
|
};
|
|
@@ -69,8 +75,8 @@ const handleResultPassed = result => {
|
|
|
69
75
|
end
|
|
70
76
|
} = result;
|
|
71
77
|
const duration = getDuration(start, end);
|
|
72
|
-
const
|
|
73
|
-
console.info(`${Pass$1} ${name} in ${
|
|
78
|
+
const formattedDuration = formatDuration(duration);
|
|
79
|
+
console.info(`${Pass$1} ${name} in ${formattedDuration}`);
|
|
74
80
|
};
|
|
75
81
|
const handleResultSkipped = result => {
|
|
76
82
|
const {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/test-with-playwright",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.4.0",
|
|
4
4
|
"description": "CLI tool for running Playwright tests",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"main": "dist/main.js",
|
|
13
13
|
"bin": "bin/test-with-playwright.js",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@lvce-editor/test-with-playwright-worker": "7.
|
|
16
|
-
"@lvce-editor/test-worker": "^6.
|
|
15
|
+
"@lvce-editor/test-with-playwright-worker": "7.4.0",
|
|
16
|
+
"@lvce-editor/test-worker": "^6.6.0"
|
|
17
17
|
},
|
|
18
18
|
"engines": {
|
|
19
19
|
"node": ">=22"
|