ackama / lighthouse-matchers

Provides RSpec matchers for executing and evaluating Google Chrome Lighthouse audit scores
MIT License
14 stars 1 forks source link

feat: raise an explicit error when the audit category is not found #56

Closed G-Rath closed 2 weeks ago

G-Rath commented 3 weeks ago

Since Lighthouse currently does not actually validate the audit/category you specific, it's possible for us to get a 'successful' run without the expected category resulting in a raw error about not being able to multiple nil by 100.

To make it easier to debug, this has us raise an explicit error in this situation so the downstream user knows its an issue with their setup rather than a bug with us - note in particular this caught us out as Lighthouse recently removed the pwa audit category which we were checking in one of our applications.

Resolves #54

G-Rath commented 3 weeks ago

(while this is ready for review, I will cherry-pick it + a few other PRs onto a dedicated branch so I can test them on a few private apps before we actually merge and release anything)