| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19156,6 +19156,18 @@ var DIAGNOSTIC_KEYS = { | |||
| 19156 | 19156 | var DIAGNOSTIC_VALUES = { | |
| 19157 | 19157 | duration_ms: (value) => `${Number(value).toFixed(3)}ms` | |
| 19158 | 19158 | }; | |
| 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 | + } | ||
| 19159 | 19171 | module.exports = async function githubReporter(source) { | |
| 19160 | 19172 | if (!process.env.GITHUB_ACTIONS) { | |
| 19161 | 19173 | for await (const _ of source) | |
@@ -19178,23 +19190,18 @@ module.exports = async function githubReporter(source) { | |||
| 19178 | 19190 | if (error?.code === "ERR_TEST_FAILURE" && error?.failureType === "subtestsFailed") { | |
| 19179 | 19191 | break; | |
| 19180 | 19192 | } | |
| 19181 | - let filePath = getFilePath(event.data.file); | ||
| 19182 | - const location = parseStack(error, filePath); | ||
| 19183 | - filePath = getFilePath(location?.file ?? filePath) ?? filePath; | ||
| 19184 | 19193 | core.error(util.inspect(error, { colors: false, breakLength: Infinity }), { | |
| 19185 | - file: filePath, | ||
| 19186 | - startLine: location?.line, | ||
| 19187 | - startColumn: location?.column, | ||
| 19194 | + ...extractLocation(event.data), | ||
| 19188 | 19195 | title: event.data.name | |
| 19189 | 19196 | }); | |
| 19190 | 19197 | counter.fail += 1; | |
| 19191 | 19198 | break; | |
| 19192 | 19199 | } | |
| 19193 | 19200 | 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) { | ||
| 19195 | 19202 | diagnostics.push(event.data.message); | |
| 19196 | 19203 | } else { | |
| 19197 | - core.notice(event.data.message, { file: getFilePath(event.data.file) }); | ||
| 19204 | + core.notice(event.data.message, extractLocation(event.data)); | ||
| 19198 | 19205 | } | |
| 19199 | 19206 | break; | |
| 19200 | 19207 | default: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | { | |
| 2 | 2 | "name": "@reporters/github", | |
| 3 | - "version": "1.5.4", | ||
| 3 | + "version": "1.6.0", | ||
| 4 | 4 | "description": "A github actions reporter for `node:test`", | |
| 5 | 5 | "type": "commonjs", | |
| 6 | 6 | "keywords": [ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments