Lighthouse CI "Assertion failed" audit budget in CI
lhci assert evaluates every assertion in your config against the collected run. When any per-audit assertion (for example audits:color-contrast or audits:image-alt) fails, lhci prints the failing audit and exits with status 1.
What this error means
lhci output lists one or more failed assertions with the audit id, the expected condition, and the found value, ending in "Assertion failed. Exiting with status code 1."
x color-contrast failure for minScore assertion
expected: >=1
found: 0
Details: Background and foreground colors do not have a sufficient contrast ratio.
Assertion failed. Exiting with status code 1.Common causes
A specific audit assertion did not pass
You asserted an individual audit (for example audits:image-alt: error) and that audit failed on the collected page.
A newly added or too-strict assertion
Adding a per-audit assertion, or using the strict preset, fails a page that has a pre-existing issue that audit measures.
How to fix it
Fix the failing audit
- Identify the audit id in the failure line.
- Apply its remedy (contrast, alt text, label association).
- Re-run
lhci autorunto confirm the assertion passes.
Tune the assertion preset or matcher
Use a preset that matches your maturity, or downgrade a specific audit to a warning while you fix the backlog.
{
"ci": {
"assert": {
"preset": "lighthouse:recommended",
"assertions": { "color-contrast": ["warn", { "minScore": 1 }] }
}
}
}How to prevent it
- Choose an assertion preset that matches the project state.
- Downgrade audits to warn only while burning down a backlog.
- Re-run collect and assert locally before pushing config changes.