Skip to content

Commit

Permalink
Fixing incorrect default throttling option
Browse files Browse the repository at this point in the history
  • Loading branch information
avasconcelos114 committed Mar 23, 2021
1 parent 1696784 commit 03fbb5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ router.post('/receive_submission', async function(req, res) {
const {channel, is_schedule} = JSON.parse(res_data.view.private_metadata);

let submission = {
throttling: true,
performance: true,
throttling: false,
performance: false,
seo: false,
pwa: false,
'best-practices': false,
Expand Down
4 changes: 2 additions & 2 deletions src/utils/lighthouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ async function launchPuppeteer(url, options) {
if (options.seo) opts.onlyCategories.push('seo');

// as throttling is enabled by default in lighthouse, disable it if explicitly unchecked
console.log(options.throttling)
if (options.throttling === false || options.throttling === 'false') {
if (options.throttling === false) {
// Values referenced in
// https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/config/constants.js
opts.throttlingMethod = 'provided';
Expand All @@ -71,6 +70,7 @@ async function launchPuppeteer(url, options) {
downloadThroughputKbps: 0,
uploadThroughputKbps: 0,
};
opts.formFactor = 'desktop'
opts.screenEmulation = {
mobile: false,
width: 1350,
Expand Down

0 comments on commit 03fbb5a

Please sign in to comment.