New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@estruyf/github-actions-reporter

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@estruyf/github-actions-reporter - npm Package Compare versions

Comparing version

to
1.3.0-beta.6159832

dist/utils/getTestStatus.js

5

CHANGELOG.md

@@ -5,2 +5,7 @@ # Changelog

## [1.3.0]
- Added warning test icon
- Added `skipped` status
## [1.2.0]

@@ -7,0 +12,0 @@

18

dist/index.js

@@ -39,3 +39,6 @@ "use strict";

const getTableRows_1 = require("./utils/getTableRows");
const checkForFailedTests_1 = require("./utils/checkForFailedTests");
const getTestStatusIcon_1 = require("./utils/getTestStatusIcon");
const summary_1 = require("@actions/core/lib/summary");
const path_2 = require("path");
const fs_1 = require("fs");
class GitHubAction {

@@ -55,2 +58,11 @@ constructor(options = {}) {

return __awaiter(this, void 0, void 0, function* () {
if (process.env.NODE_ENV === "development") {
const summaryFile = (0, path_2.join)(__dirname, "../summary.html");
if ((0, fs_1.existsSync)(summaryFile)) {
(0, fs_1.unlinkSync)(summaryFile);
}
(0, fs_1.writeFileSync)(summaryFile, "", "utf-8");
process.env[summary_1.SUMMARY_ENV_VAR] = summaryFile;
process.env.GITHUB_ACTIONS = "true";
}
if (process.env.GITHUB_ACTIONS && this.suite) {

@@ -88,4 +100,4 @@ const os = process.platform;

// Check if there are any failed tests
const hasFailedTests = (0, checkForFailedTests_1.checkForFailedTests)(tests[filePath]);
summary.addDetails(`${hasFailedTests ? "❌" : "✅"} ${fileName} (${os}${project.name ? ` / ${project.name}` : ""})`, content);
const testStatusIcon = (0, getTestStatusIcon_1.getTestStatusIcon)(tests[filePath]);
summary.addDetails(`${testStatusIcon} ${fileName} (${os}${project.name ? ` / ${project.name}` : ""})`, content);
}

@@ -92,0 +104,0 @@ else {

3

dist/utils/getHtmlTable.js

@@ -8,2 +8,3 @@ "use strict";

const ansi_to_html_1 = __importDefault(require("ansi-to-html"));
const getTestStatus_1 = require("./getTestStatus");
const getHtmlTable = (tests, showError) => {

@@ -31,3 +32,3 @@ const convert = new ansi_to_html_1.default();

content.push(`<td>${test.title}</td>`);
content.push(`<td>${result.status === "passed" ? "✅ Pass" : "❌ Fail"}</td>`);
content.push(`<td>${(0, getTestStatus_1.getTestStatus)(result)}</td>`);
content.push(`<td>${result.duration / 1000}s</td>`);

@@ -34,0 +35,0 @@ content.push(`<td>${result.retry}</td>`);

@@ -8,2 +8,3 @@ "use strict";

const ansi_to_html_1 = __importDefault(require("ansi-to-html"));
const getTestStatus_1 = require("./getTestStatus");
const getTableRows = (tests, showError) => {

@@ -45,3 +46,3 @@ const convert = new ansi_to_html_1.default();

{
data: result.status === "passed" ? "✅ Pass" : "❌ Fail",
data: (0, getTestStatus_1.getTestStatus)(result),
header: false,

@@ -48,0 +49,0 @@ },

{
"name": "@estruyf/github-actions-reporter",
"version": "1.2.0",
"version": "1.3.0-beta.6159832",
"description": "GitHub Actions reporter for Playwright",

@@ -9,3 +9,4 @@ "main": "dist/index.js",

"watch": "tsc -w",
"test": "npx playwright test"
"test": "NODE_ENV=development npx playwright test",
"test:local": "act -j testing -P ubuntu-latest=catthehacker/ubuntu:act-latest --container-architecture linux/amd64 --env GITHUB_STEP_SUMMARY='/dev/stdout'"
},

@@ -44,2 +45,2 @@ "author": "Elio Struyf <elio@struyfconsulting.be>",

}
}
}