vitest-github-actions-reporter
Advanced tools
Comparing version 0.10.0 to 0.11.0
@@ -21,4 +21,4 @@ import { Reporter, Vitest, File } from 'vitest'; | ||
private reportTasks; | ||
private reportSuiteError; | ||
private reportTest; | ||
private reportTaskErrors; | ||
private reportTaskError; | ||
private parseStacktrace; | ||
@@ -30,2 +30,2 @@ private createMessage; | ||
export { GitHubActionsReporterOptions, GitHubActionsReporter as default }; | ||
export { type GitHubActionsReporterOptions, GitHubActionsReporter as default }; |
@@ -100,2 +100,4 @@ // src/index.ts | ||
var GitHubActionsReporter = class { | ||
ctx; | ||
options; | ||
constructor({ | ||
@@ -121,7 +123,4 @@ trimRepositoryPrefix = true, | ||
reportFiles(files) { | ||
var _a2; | ||
for (const file of files) { | ||
if ((_a2 = file.result) == null ? void 0 : _a2.error) { | ||
this.reportSuiteError(file.filepath, file); | ||
} | ||
this.reportTaskErrors(file.filepath, file); | ||
this.reportTasks(file.filepath, file.tasks); | ||
@@ -131,11 +130,8 @@ } | ||
reportTasks(filename, tasks) { | ||
var _a2; | ||
for (const task of tasks) { | ||
if (task.type === "suite") { | ||
if ((_a2 = task.result) == null ? void 0 : _a2.error) { | ||
this.reportSuiteError(filename, task); | ||
} | ||
this.reportTaskErrors(filename, task); | ||
this.reportTasks(filename, task.tasks); | ||
} else if (task.type === "test") { | ||
this.reportTest(filename, task); | ||
this.reportTaskErrors(filename, task); | ||
} else if (task.type === "custom") { | ||
@@ -147,17 +143,10 @@ } else { | ||
} | ||
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); | ||
const position = this.getPositionFromError(filename, stackTrace); | ||
const message = this.createMessage(stackTrace); | ||
error(message, { | ||
...position, | ||
title: this.getErrorTitle((_c = suite.result) == null ? void 0 : _c.error, "Failed Suite") | ||
}); | ||
reportTaskErrors(filename, task) { | ||
var _a2; | ||
for (const err of ((_a2 = task.result) == null ? void 0 : _a2.errors) ?? []) { | ||
this.reportTaskError(task.type, filename, err); | ||
} | ||
} | ||
reportTest(filename, test) { | ||
var _a2, _b, _c, _d; | ||
if (((_a2 = test.result) == null ? void 0 : _a2.state) !== "fail") | ||
return; | ||
const stackTrace = this.parseStacktrace((_c = (_b = test.result) == null ? void 0 : _b.error) == null ? void 0 : _c.stackStr); | ||
reportTaskError(taskType, filename, err) { | ||
const stackTrace = this.parseStacktrace(err.stackStr); | ||
const position = this.getPositionFromError(filename, stackTrace); | ||
@@ -167,3 +156,6 @@ const message = this.createMessage(stackTrace); | ||
...position, | ||
title: this.getErrorTitle((_d = test.result) == null ? void 0 : _d.error, "Failed Test") | ||
title: this.getErrorTitle( | ||
err, | ||
`Failed ${taskType[0].toUpperCase()}${taskType.slice(1)}` | ||
) | ||
}); | ||
@@ -170,0 +162,0 @@ } |
{ | ||
"name": "vitest-github-actions-reporter", | ||
"version": "0.10.0", | ||
"version": "0.11.0", | ||
"description": "Vitest reporter to create annotations when running tests in GitHub Actions", | ||
@@ -40,13 +40,13 @@ "type": "module", | ||
"devDependencies": { | ||
"@types/node": "^18.14.1", | ||
"@typescript-eslint/eslint-plugin": "^5.53.0", | ||
"@typescript-eslint/parser": "^5.53.0", | ||
"eslint": "^8.35.0", | ||
"eslint-config-prettier": "^8.6.0", | ||
"execa": "^7.0.0", | ||
"prettier": "^2.8.4", | ||
"tsup": "^6.6.3", | ||
"typescript": "^4.9.5", | ||
"vite": "^4.1.4", | ||
"vitest": "^0.29.1" | ||
"@types/node": "^20.9.2", | ||
"@typescript-eslint/eslint-plugin": "^6.11.0", | ||
"@typescript-eslint/parser": "^6.11.0", | ||
"eslint": "^8.54.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-vitest": "^0.3.9", | ||
"execa": "^8.0.1", | ||
"prettier": "^3.1.0", | ||
"tsup": "^7.3.0", | ||
"typescript": "^5.2.2", | ||
"vitest": "^1.0.0-beta.5" | ||
}, | ||
@@ -56,3 +56,3 @@ "dependencies": { | ||
}, | ||
"packageManager": "pnpm@7.28.0", | ||
"packageManager": "pnpm@8.10.5", | ||
"scripts": { | ||
@@ -59,0 +59,0 @@ "build": "tsup", |
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
2
42213
439