From 98205ec7d07b2ad79ea1cf24ecb53bb28baa141e Mon Sep 17 00:00:00 2001 From: Jem Young Date: Tue, 27 Jun 2017 22:01:34 -0700 Subject: [PATCH 1/2] Update readme * Show `chromeFlags` as a usable feature flag * Add `options` example --- readme.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 173ac9c..2cb5dc8 100644 --- a/readme.md +++ b/readme.md @@ -115,6 +115,7 @@ module.exports = { upload: true, // turn on uploading to Google Drive view: true, // open uploaded traces to Google Drive in DevTools expectations: true // turn on assertation metrics results against provides values + chromeFlags: [] // custom flags to pass to Chrome. For a full list of flags, see http://peter.sh/experiments/chromium-command-line-switches/. }, expectations: { // these expectations values are examples, for your cases set your own @@ -303,6 +304,19 @@ module.exports = { ```js const PWMetrics = require('pwmetrics'); +const options = { + flags: { + runs: '3', // number or runs + submit: true, // turn on submitting to Google Sheets + upload: true, // turn on uploading to Google Drive + view: true, // open uploaded traces to Google Drive in DevTools + expectations: true // turn on assertation metrics results against provides values + chromeFlags: [ + '--headless' // run in headless Chrome + ] + } +}; + const pwMetrics = new PWMetrics('http://example.com/', options); // _All available configuration options_ can be used as `options` pwMetrics.start(); // returns Promise @@ -331,7 +345,8 @@ pwMetrics.start(); // returns Promise upload: false, view: false, expectations: false, - disableCpuThrottling: false + disableCpuThrottling: false, + chromeFlags: [] } From a70805cc50c70e04391621eaa51a42899026693f Mon Sep 17 00:00:00 2001 From: Jem Young Date: Thu, 29 Jun 2017 00:31:12 -0700 Subject: [PATCH 2/2] Update readme to show lighthouse flag support --- readme.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 2cb5dc8..838c36d 100644 --- a/readme.md +++ b/readme.md @@ -115,7 +115,8 @@ module.exports = { upload: true, // turn on uploading to Google Drive view: true, // open uploaded traces to Google Drive in DevTools expectations: true // turn on assertation metrics results against provides values - chromeFlags: [] // custom flags to pass to Chrome. For a full list of flags, see http://peter.sh/experiments/chromium-command-line-switches/. + chromeFlags: [] // custom flags to pass to Chrome. For a full list of flags, see http://peter.sh/experiments/chromium-command-line-switches/. + // Note: pwmetrics supports all flags from Lighthouse }, expectations: { // these expectations values are examples, for your cases set your own @@ -335,7 +336,7 @@ pwMetrics.start(); // returns Promise - flags + flags* Object
@@ -376,6 +377,9 @@ pwMetrics.start(); // returns Promise
   
 
 
+*pwmetrics supports all flags from Lighthouse. See [here](https://github.com/GoogleChrome/lighthouse/#cli-options) for the complete list.
+
+
 ### Recipes
 
 - [gulp](/recipes/gulp/gulpfile.js)