Using lighthouse and lighthouse-core with Mocha to run tests on your project/site.
Basic example that gathers performance metrics via Lighthouse and tests them in Mocha. Tested against Chrome headless_shell (available via my Docker container)
$ docker pull justinribeiro/chrome-headless
$ docker run -d --net host justinribeiro/chrome-headless
$ git clone git@github.com:justinribeiro/lighthouse-mocha-example.git
$ cd lighthouse-mocha-example
$ npm install
$ npm test
Indeed you can. See the included .travis.yml
to give you a basic idea of how it works or see the screenshot below.