@jieay/dsh-tester 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/report.js +3 -0
- package/package.json +1 -1
package/lib/report.js
CHANGED
|
@@ -74,6 +74,9 @@ export function auditReportMarkdown(report, options = {}) {
|
|
|
74
74
|
if (page.navigationError) problems.push('导航失败')
|
|
75
75
|
if (page.redirectedToLogin) problems.push('跳到登录页(会话未登录)')
|
|
76
76
|
if (page.consoleErrors.length) problems.push(`console.error ${page.consoleErrors.length}`)
|
|
77
|
+
// 失败请求也算证据:哪怕是被导航打断的 ERR_ABORTED,也不该在摘要里显示为「—」,
|
|
78
|
+
// 否则读者会以为这页毫无异常,而 audit.json 里其实有记录。
|
|
79
|
+
if (page.failedRequests.length) problems.push(`失败请求 ${page.failedRequests.length}`)
|
|
77
80
|
const cells = [page.url, page.status, page.ok ? '通过' : '失败', problems.join(';') || '—']
|
|
78
81
|
if (inFolder) cells.push(page.screenshot ? `[查看](${basename(page.screenshot)})` : '—')
|
|
79
82
|
lines.push(`| ${cells.join(' | ')} |`)
|