cli
cli copied to clipboard
`skipAudits` flag is not processed correctly by lighthouse
What happened?
When I configure a audit slug for skipAudits
in the plugin options the audit is filtered out from the plugin config audits but the listed audits still show up in the audit outputs of the plugin. Therefor we had to implement the normalizeAuditOutputs
function to overcome the validation.
What would you expect to happen?
That runLighthouse
processes the passed flags correctly
What steps did you take?
Ensure original logic:
- ✅ run
npx lighthouse https://example.com --skipAudits is-on-https --output json --output-path report.json
- ✅ ensure
audits
do NOT containis-on-https
- ✅ ensure
configSetings.skipAudits
is set to["is-on-https"]
Ensure cp logic:
- ✅ run
nx code-pushup -- --onlyPlugins lighthouse
with the following plugin configuration
await lighthousePlugin('https://codepushup.dev/', { skipAudits: ['is-on-https'] })
- ✅ ensure
skipAudits
is passed intorunLighthouse
- ❌ ensure
audits
do NOT containis-on-https
=> the audit is present - ✅ ensure
configSetings.skipAudits
is set to["is-on-https"]
Related source links:
- https://github.com/GoogleChrome/lighthouse/blob/65b65250e7854adcd9ecadeb5299aa4c80fdafc8/cli/run.js#L137
- https://github.com/GoogleChrome/lighthouse/blob/c35b375c6f31c6d658dd65d9ab91f158eec759f0/core/config/filters.js#L265
Code PushUp package version
No response
What operation system are you on?
MacOS
Node version
No response
Relevant log output
No response