mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-19 07:27:09 +01:00
Features/add links to report (#1)
* Return links to summary report * Rebuild
This commit is contained in:
parent
38ed5b9df1
commit
ecc64ae3ff
20 changed files with 30 additions and 24 deletions
9
dist/index.js
generated
vendored
9
dist/index.js
generated
vendored
|
|
@ -2034,14 +2034,17 @@ function getTestRunsReport(testRuns, options) {
|
|||
}
|
||||
if (testRuns.length > 0 || options.onlySummary) {
|
||||
const tableData = testRuns
|
||||
.filter(tr => tr.passed > 0 || tr.failed > 0 || tr.skipped > 0)
|
||||
.map(tr => {
|
||||
.map((tr, originalIndex) => ({ tr, originalIndex }))
|
||||
.filter(({ tr }) => tr.passed > 0 || tr.failed > 0 || tr.skipped > 0)
|
||||
.map(({ tr, originalIndex }) => {
|
||||
const time = (0, markdown_utils_1.formatTime)(tr.time);
|
||||
const name = tr.path;
|
||||
const addr = options.baseUrl + makeRunSlug(originalIndex, options).link;
|
||||
const nameLink = (0, markdown_utils_1.link)(name, addr);
|
||||
const passed = tr.passed > 0 ? `${tr.passed} ${markdown_utils_1.Icon.success}` : '';
|
||||
const failed = tr.failed > 0 ? `${tr.failed} ${markdown_utils_1.Icon.fail}` : '';
|
||||
const skipped = tr.skipped > 0 ? `${tr.skipped} ${markdown_utils_1.Icon.skip}` : '';
|
||||
return [name, passed, failed, skipped, time];
|
||||
return [nameLink, passed, failed, skipped, time];
|
||||
});
|
||||
const resultsTable = (0, markdown_utils_1.table)(['Report', 'Passed', 'Failed', 'Skipped', 'Time'], [markdown_utils_1.Align.Left, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right], ...tableData);
|
||||
sections.push(resultsTable);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue