vitest-github-actions-reporter
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -64,5 +64,3 @@ var __defProp = Object.defineProperty; | ||
// src/stacktrace/stringify.ts | ||
var _a; | ||
var repository = ((_a = process.env.GITHUB_REPOSITORY) == null ? void 0 : _a.split("/")[1]) ?? ""; | ||
var prefixes = [`D:\\a\\${repository}\\`, `/home/runner/${repository}/`]; | ||
var repositoryPrefixes = [`D:/a/`, `/home/runner/`]; | ||
var stringifyStacktrace = (stack, trimRepositoryPrefix) => { | ||
@@ -72,3 +70,3 @@ return stack.map((s) => { | ||
if (trimRepositoryPrefix) { | ||
file = trimPrefixes(file, prefixes); | ||
file = trimPrefixes(file, repositoryPrefixes); | ||
} | ||
@@ -78,4 +76,4 @@ return ` at ${s.method ? `${s.method} ` : ""}${file}:${s.line}:${s.column}`; | ||
}; | ||
var trimPrefixes = (str, prefixes2) => { | ||
for (const p of prefixes2) { | ||
var trimPrefixes = (str, prefixes) => { | ||
for (const p of prefixes) { | ||
if (str.startsWith(p)) { | ||
@@ -111,5 +109,5 @@ str = str.slice(p.length); | ||
reportFiles(files) { | ||
var _a2; | ||
var _a; | ||
for (const file of files) { | ||
if ((_a2 = file.result) == null ? void 0 : _a2.error) { | ||
if ((_a = file.result) == null ? void 0 : _a.error) { | ||
this.reportSuiteError(file.filepath, file); | ||
@@ -121,6 +119,6 @@ } | ||
reportTasks(filename, tasks) { | ||
var _a2; | ||
var _a; | ||
for (const task of tasks) { | ||
if (task.type === "suite") { | ||
if ((_a2 = task.result) == null ? void 0 : _a2.error) { | ||
if ((_a = task.result) == null ? void 0 : _a.error) { | ||
this.reportSuiteError(filename, task); | ||
@@ -135,4 +133,4 @@ } | ||
reportSuiteError(filename, suite) { | ||
var _a2, _b, _c; | ||
const stackTrace = this.parseStacktrace((_b = (_a2 = suite.result) == null ? void 0 : _a2.error) == null ? void 0 : _b.stackStr); | ||
var _a, _b, _c; | ||
const stackTrace = this.parseStacktrace((_b = (_a = suite.result) == null ? void 0 : _a.error) == null ? void 0 : _b.stackStr); | ||
const position = this.getPositionFromError(filename, stackTrace); | ||
@@ -145,4 +143,4 @@ const message = this.createMessage(stackTrace); | ||
reportTest(filename, test) { | ||
var _a2, _b, _c, _d; | ||
if (((_a2 = test.result) == null ? void 0 : _a2.state) !== "fail") | ||
var _a, _b, _c, _d; | ||
if (((_a = test.result) == null ? void 0 : _a.state) !== "fail") | ||
return; | ||
@@ -149,0 +147,0 @@ const stackTrace = this.parseStacktrace((_c = (_b = test.result) == null ? void 0 : _b.error) == null ? void 0 : _c.stackStr); |
{ | ||
"name": "vitest-github-actions-reporter", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Vitest reporter to create annotations when running tests in GitHub Actions", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
0
34585
400