boyney123 / garie-lighthouse

Lighthouse Garie plugin. Polls websites to checkout performance metrics also supports webhooks.
MIT License
50 stars 24 forks source link

Add ability to pass custom Lighthouse config object #8

Closed gidztech closed 5 years ago

gidztech commented 5 years ago

What:

Added ability to pass in a config object into the lighthouse plugin which directly maps to the object you would pass to the lighthouse module.

Why:

Currently garie-lighthouse uses the default preset configuration for running audits, which is an emulated mobile device with some level of throttling. However, it would be beneficial to be able to audit as a desktop device and with varying levels of throttling.

How:

You can add the following inside urls in config.json.

"url": "https://www.google.com",
"plugins": [
    {
        "name": "lighthouse",
        "report": true,
        "config": {
            "extends": "lighthouse:default",
            "settings": {
                "emulatedFormFactor": "desktop"
            }
        }
    }
]

There are many other configurations one could use as referenced here.

Checklist:

Regarding tests, I've added one simple test to assert that the config is passed through correctly to the Lighthouse API, but I don't think it's necessary to test the data that comes back otherwise we are testing their code.

By the way, there are no contributing guidelines and no table to add myself.

codecov-io commented 5 years ago

Codecov Report

Merging #8 into master will not change coverage. The diff coverage is 100%.

@@           Coverage Diff           @@
##           master       #8   +/-   ##
=======================================
  Coverage   93.33%   93.33%           
=======================================
  Files           5        5           
  Lines         135      135           
  Branches       25       25           
=======================================
  Hits          126      126           
  Misses          9        9
boyney123 commented 5 years ago

@gidztech Thanks for the contribution! Sorry its taken so long !

boyney123 commented 5 years ago

I'm looking for help to maintain Garie, would you be interested @gidztech :)?