Skip to content

Commit

Permalink
fix: exclude skipped tests from report (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlockhart authored Aug 11, 2023
1 parent 4b59741 commit fb449a8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
13 changes: 8 additions & 5 deletions src/server/report/result.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,14 @@ export function renderBrowserResults(browser, tests, options) {
return acc;
}

let status = STATUS_TYPE.WARNING;
if (resultData.duration > resultData.info.slowDuration) {
status = STATUS_TYPE.ERROR;
} else if (resultData.duration < (resultData.info.slowDuration / 2)) {
status = STATUS_TYPE.NORMAL;
let status = STATUS_TYPE.NORMAL;
if (resultData.info) {
status = STATUS_TYPE.WARNING;
if (resultData.duration > resultData.info.slowDuration) {
status = STATUS_TYPE.ERROR;
} else if (resultData.duration < (resultData.info.slowDuration / 2)) {
status = STATUS_TYPE.NORMAL;
}
}

return acc.push(html`
Expand Down
7 changes: 6 additions & 1 deletion src/server/visual-diff-reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ function flattenResults(session, browserData, fileData) {
tests.forEach(t => {
const testName = `${prefix}${t.name}`;
const testKey = testName.replaceAll(' > ', ' ');
const info = getTestInfo(session, testKey);

// tests missing info but with no error were skipped via grep, so exclude them
if (!info && !t.error) return;

if (!fileData.tests.has(testName)) {
fileData.tests.set(testName, {
name: testName,
Expand All @@ -87,7 +92,7 @@ function flattenResults(session, browserData, fileData) {
duration: t.duration,
error: t.error?.message,
passed: t.passed,
info: getTestInfo(session, testKey)
info: info
});
});
}
Expand Down

0 comments on commit fb449a8

Please sign in to comment.