Doctor: the performance rules are errors (owner's decision for 1.18.0); lowered or silenced per rule in iapl-doctor.json; growth stays warnings; audit reports them as errors; legacy:site lists perf-* errors an old site meets; docs, skills, changelog; reference skills refreshed
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f0127ac1b8
commit
8cf5a58045
@@ -30,7 +30,7 @@ function project(files: Record<string, string>): string {
|
||||
}
|
||||
return root
|
||||
}
|
||||
const doctor = (root: string, only: string[], extra: { deepStatus?: object; url?: string } = {}) =>
|
||||
const doctor = (root: string, only: string[], extra: { config?: object; deepStatus?: object; url?: string } = {}) =>
|
||||
runDoctor({ offline: true, only, packageRoot, root, today: '2026-12-01', writeSeen: false, ...extra })
|
||||
/** Each line starts with the expected text, in order. */
|
||||
const startWith = (lines: string[], expected: string[]) => {
|
||||
@@ -84,9 +84,15 @@ describe('doctor: performance group (static)', () => {
|
||||
'perf-animations: the site animates (@keyframes',
|
||||
])
|
||||
expect(by('perf-budgets')).toHaveLength(1)
|
||||
// every finding is a warning (info for the budget test) in 1.18.0: reported, never failing CI
|
||||
// every finding is an error since 1.18.0 (the owner's decision): iapl-doctor fails on them
|
||||
const report = await doctor(root, ['performance'])
|
||||
expect(new Set(report.findings.map((f) => f.severity))).toEqual(new Set(['info', 'warning']))
|
||||
expect(new Set(report.findings.map((f) => f.severity))).toEqual(new Set(['error']))
|
||||
// … and a project lowers one or silences one, with a reason, in iapl-doctor.json
|
||||
const config = { rules: { 'perf-embeds': { off: true, reason: 'the map is the page (client decision)' }, 'perf-fonts': { reason: 'the brand font from the client, being replaced', severity: 'warning' } } }
|
||||
const adapted = await doctor(root, ['performance'], { config })
|
||||
expect(new Set(adapted.findings.filter((f) => f.rule === 'perf-fonts').map((f) => f.severity))).toEqual(new Set(['warning']))
|
||||
expect(adapted.findings.filter((f) => f.rule === 'perf-embeds').every((f) => f.silenced)).toBe(true)
|
||||
expect(adapted.summary.error).toBe(report.summary.error - 4 - 1) // four font findings lowered, the map silenced
|
||||
})
|
||||
|
||||
test('a remote stylesheet <link> is reported as render-blocking', async () => {
|
||||
|
||||
Reference in New Issue
Block a user