Skip to content
Latchkey

Lighthouse CI accessibility score below assertion in CI

lhci assert compared the run accessibility category score against your assertion (for example minScore: 0.9) and it was lower, so the assertion failed and the job exits non-zero. The report names which audits dragged the score down.

What this error means

lhci autorun prints an assertion failure for categories:accessibility showing the expected minimum and the actual score, followed by the failing audits (color-contrast, image-alt, label).

lhci
Checking assertions against 1 URL, 1 total run(s)

1 result(s) for http://localhost:3000/ :

  x  categories:accessibility failure for minScore assertion
       expected: >=0.9
          found: 0.84
     all values: 0.84

Assertion failed. Exiting with status code 1.

Common causes

Failing audits lowered the accessibility score

Lighthouse weights audits like color-contrast, image-alt, and label into the category score; each failure reduces it below the asserted minimum.

The assertion was newly added or raised

Introducing minScore: 0.9 (or raising it) on a page that historically scored lower fails immediately, even with no new defects.

How to fix it

Fix the audits that failed

  1. Open the Lighthouse report and read the failing accessibility audits.
  2. Fix each (contrast to 4.5:1, add alt, associate labels) to raise the score.
  3. Re-run lhci autorun to confirm the score meets the assertion.
Terminal
lhci autorun

Set the assertion to a realistic minimum

Assert a minScore the page can currently meet, then ratchet it upward as you fix audits, so the gate reflects real state.

lighthouserc.json
// lighthouserc.json
{
  "ci": {
    "assert": {
      "assertions": {
        "categories:accessibility": ["error", { "minScore": 0.9 }]
      }
    }
  }
}

How to prevent it

  • Run lhci on PRs so accessibility regressions show up before merge.
  • Ratchet minScore upward gradually as audits are fixed.
  • Read the underlying audits, not just the aggregate score.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →