@@ -19156,6 +19156,18 @@ var DIAGNOSTIC_KEYS = {
1915619156var DIAGNOSTIC_VALUES = {
1915719157 duration_ms: (value) => `${Number(value).toFixed(3)}ms`
1915819158};
19159+ function extractLocation(data) {
19160+ let { line, column, file } = data;
19161+ const error = data.details?.error;
19162+ file = getFilePath(file);
19163+ if (error) {
19164+ const errorLocation = parseStack(error, file);
19165+ file = getFilePath(errorLocation?.file ?? file) ?? file;
19166+ line = errorLocation?.line ?? line;
19167+ column = errorLocation?.column ?? column;
19168+ }
19169+ return { file, startLine: line, startColumn: column };
19170+ }
1915919171module.exports = async function githubReporter(source) {
1916019172 if (!process.env.GITHUB_ACTIONS) {
1916119173 for await (const _ of source)
@@ -19178,23 +19190,18 @@ module.exports = async function githubReporter(source) {
1917819190 if (error?.code === "ERR_TEST_FAILURE" && error?.failureType === "subtestsFailed") {
1917919191 break;
1918019192 }
19181- let filePath = getFilePath(event.data.file);
19182- const location = parseStack(error, filePath);
19183- filePath = getFilePath(location?.file ?? filePath) ?? filePath;
1918419193 core.error(util.inspect(error, { colors: false, breakLength: Infinity }), {
19185- file: filePath,
19186- startLine: location?.line,
19187- startColumn: location?.column,
19194+ ...extractLocation(event.data),
1918819195 title: event.data.name
1918919196 });
1919019197 counter.fail += 1;
1919119198 break;
1919219199 }
1919319200 case "test:diagnostic":
19194- if (event.data.nesting === 0) {
19201+ if (event.data.file === void 0 || event.data.line === void 0 || event.data.column === void 0) {
1919519202 diagnostics.push(event.data.message);
1919619203 } else {
19197- core.notice(event.data.message, { file: getFilePath (event.data.file) } );
19204+ core.notice(event.data.message, extractLocation (event.data) );
1919819205 }
1919919206 break;
1920019207 default:
0 commit comments