@reporters/github 1.12.0 → 1.13.1
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/index.js +24 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -82,9 +82,9 @@ function transformEvent(event) {
|
|
|
82
82
|
return new Command('debug', {}, `completed running ${event.data.name}`).toString();
|
|
83
83
|
case 'test:fail': {
|
|
84
84
|
const error = event.data.details?.error;
|
|
85
|
-
if (error
|
|
86
|
-
//
|
|
87
|
-
// no need to re-annotate the file itself
|
|
85
|
+
if (!error || (error.code === 'ERR_TEST_FAILURE' && error.failureType === 'subtestsFailed')) {
|
|
86
|
+
// Either no error object on the event, or failed subtests are already
|
|
87
|
+
// reported — no need to re-annotate the file itself.
|
|
88
88
|
break;
|
|
89
89
|
}
|
|
90
90
|
const err = error.code === 'ERR_TEST_FAILURE' ? error.cause : error;
|
|
@@ -100,6 +100,27 @@ function transformEvent(event) {
|
|
|
100
100
|
return new Command('notice', toCommandProperties(extractLocation(event.data)), `${event.data.message}`).toString();
|
|
101
101
|
}
|
|
102
102
|
break;
|
|
103
|
+
/* c8 ignore start */
|
|
104
|
+
case 'test:interrupted': {
|
|
105
|
+
const { tests } = event.data;
|
|
106
|
+
let res = '';
|
|
107
|
+
for (let i = 0; i < tests.length; i += 1) {
|
|
108
|
+
const test = tests[i];
|
|
109
|
+
const file = test.file ? getFilePath(test.file) : undefined;
|
|
110
|
+
let msg = `Interrupted while running: ${test.name}`;
|
|
111
|
+
if (file) {
|
|
112
|
+
msg += ` at ${file}:${test.line}:${test.column}`;
|
|
113
|
+
}
|
|
114
|
+
res += new Command('warning', toCommandProperties({
|
|
115
|
+
file,
|
|
116
|
+
startLine: test.line,
|
|
117
|
+
startColumn: test.column,
|
|
118
|
+
title: `Interrupted: ${test.name}`,
|
|
119
|
+
}), msg).toString();
|
|
120
|
+
}
|
|
121
|
+
return res;
|
|
122
|
+
}
|
|
123
|
+
/* c8 ignore stop */
|
|
103
124
|
default:
|
|
104
125
|
break;
|
|
105
126
|
}
|