@reporters/github
Advanced tools
Comparing version 1.7.1 to 1.7.2
16
index.js
'use strict'; | ||
const path = require('node:path'); | ||
const { fileURLToPath } = require('node:url'); | ||
const util = require('node:util'); | ||
@@ -15,8 +16,11 @@ const { EOL } = require('node:os'); | ||
const getRelativeFilePath = (name) => (isFile(name) ? path.relative(WORKSPACE, require.resolve(name) ?? '') : null); | ||
const getRelativeFilePath = (name) => (isFile(name) ? path.relative(WORKSPACE, name) : null); | ||
function getFilePath(fileName) { | ||
if (fileName.startsWith('file://')) { | ||
return getRelativeFilePath(new URL(fileName).pathname); | ||
return getRelativeFilePath(fileURLToPath(fileName)); | ||
} | ||
if (!path.isAbsolute(fileName)) { | ||
return getRelativeFilePath(path.resolve(fileName) ?? ''); | ||
} | ||
return getRelativeFilePath(fileName); | ||
@@ -105,3 +109,3 @@ } | ||
} | ||
const formatedDiagnostics = diagnostics.map((d) => { | ||
const formattedDiagnostics = diagnostics.map((d) => { | ||
const [key, ...rest] = d.split(' '); | ||
@@ -114,4 +118,4 @@ const value = rest.join(' '); | ||
}); | ||
core.startGroup(`Test results (${formatedDiagnostics.find(([key]) => key === DIAGNOSTIC_KEYS.pass)?.[1] ?? counter.pass} passed, ${formatedDiagnostics.find(([key]) => key === DIAGNOSTIC_KEYS.fail)?.[1] ?? counter.fail} failed)`); | ||
core.notice(formatedDiagnostics.map((d) => d.join(': ')).join(EOL)); | ||
core.startGroup(`Test results (${formattedDiagnostics.find(([key]) => key === DIAGNOSTIC_KEYS.pass)?.[1] ?? counter.pass} passed, ${formattedDiagnostics.find(([key]) => key === DIAGNOSTIC_KEYS.fail)?.[1] ?? counter.fail} failed)`); | ||
core.notice(formattedDiagnostics.map((d) => d.join(': ')).join(EOL)); | ||
core.endGroup(); | ||
@@ -122,5 +126,5 @@ | ||
.addHeading('Test Results') | ||
.addTable(formatedDiagnostics) | ||
.addTable(formattedDiagnostics) | ||
.write(); | ||
} | ||
}; |
{ | ||
"name": "@reporters/github", | ||
"version": "1.7.1", | ||
"version": "1.7.2", | ||
"description": "A github actions reporter for `node:test`", | ||
@@ -5,0 +5,0 @@ "type": "commonjs", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
6369
112
4