Skip to content

Commit

Permalink
fix: default(.json -> .js). Disable css usage audit (#1911)
Browse files Browse the repository at this point in the history
* fix: disable css usage audit

* mv default.json -> default.js FTW!
  • Loading branch information
patrickhulce committed Mar 28, 2017
1 parent 5034961 commit 1708865
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 26 deletions.
21 changes: 11 additions & 10 deletions lighthouse-cli/test/smokehouse/byte-efficiency/expectations.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@ module.exports = [
initialUrl: 'http://localhost:10200/byte-efficiency/tester.html',
url: 'http://localhost:10200/byte-efficiency/tester.html',
audits: {
'unused-css-rules': {
score: false,
extendedInfo: {
value: {
results: {
length: 2
}
}
}
},
// TODO: re-enable once CSS protocol has stabilized
// 'unused-css-rules': {
// score: false,
// extendedInfo: {
// value: {
// results: {
// length: 2
// }
// }
// }
// },
'offscreen-images': {
score: false,
extendedInfo: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ node lighthouse-cli/test/fixtures/static-server.js &

sleep 0.5s

config="lighthouse-core/config/default.json"
config="lighthouse-core/config/default.js"
expectations="lighthouse-cli/test/smokehouse/byte-efficiency/expectations.js"

npm run -s smokehouse -- --config-path=$config --expectations-path=$expectations
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-cli/test/smokehouse/dobetterweb/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ node lighthouse-cli/test/fixtures/static-server.js &

sleep 0.5s

config="lighthouse-core/config/default.json"
config="lighthouse-core/config/default.js"
expectations="lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js"

# run smoketest on DBW test page.
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-cli/test/smokehouse/offline-local/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ node lighthouse-cli/test/fixtures/static-server.js &

sleep 0.5s

config="lighthouse-core/config/default.json"
config="lighthouse-core/config/default.js"
expectations="lighthouse-cli/test/smokehouse/offline-local/offline-expectations.js"

# run smoketest, expecting results found in offline-expectations
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*/
'use strict';

const defaultConfigPath = './default.json';
const defaultConfig = require('./default.json');
const defaultConfigPath = './default.js';
const defaultConfig = require('./default.js');
const recordsFromLogs = require('../lib/network-recorder').recordsFromLogs;

const GatherRunner = require('../gather/gather-runner');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
/* eslint-disable */
module.exports = {
"passes": [{
"passName": "defaultPass",
"recordNetwork": true,
Expand Down Expand Up @@ -112,7 +113,7 @@
"accessibility/video-caption",
"accessibility/video-description",
"byte-efficiency/total-byte-weight",
"byte-efficiency/unused-css-rules",
// "byte-efficiency/unused-css-rules",
"byte-efficiency/offscreen-images",
"byte-efficiency/uses-optimized-images",
"byte-efficiency/uses-responsive-images",
Expand Down Expand Up @@ -540,10 +541,10 @@
"expectedValue": true,
"weight": 1
},
"unused-css-rules": {
"expectedValue": true,
"weight": 1
},
// "unused-css-rules": {
// "expectedValue": true,
// "weight": 1
// },
"link-blocking-first-paint": {
"expectedValue": true,
"weight": 1
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/test/config/config-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
const Config = require('../../config/config');
const assert = require('assert');
const path = require('path');
const defaultConfig = require('../../config/default.json');
const defaultConfig = require('../../config/default.js');
const log = require('../../lib/log');
const Gatherer = require('../../gather/gatherers/gatherer');
const Audit = require('../../audits/audit');
Expand Down Expand Up @@ -191,7 +191,7 @@ describe('Config', () => {
});

it('throws on a non-absolute config path', () => {
const configPath = '../../config/default.json';
const configPath = '../../config/default.js';

return assert.throws(_ => new Config({
audits: []
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-extension/app/src/lighthouse-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const ExtensionProtocol = require('../../../lighthouse-core/gather/connections/e
const RawProtocol = require('../../../lighthouse-core/gather/connections/raw');
const Runner = require('../../../lighthouse-core/runner');
const Config = require('../../../lighthouse-core/config/config');
const defaultConfig = require('../../../lighthouse-core/config/default.json');
const defaultConfig = require('../../../lighthouse-core/config/default.js');
const log = require('../../../lighthouse-core/lib/log');

const ReportGenerator = require('../../../lighthouse-core/report/report-generator');
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ right corner and signing in to GitHub.

* [webpack-lighthouse-plugin](https://github.com/addyosmani/webpack-lighthouse-plugin) - run Lighthouse from a Webpack build.
* [lighthouse-mocha-example](https://github.com/justinribeiro/lighthouse-mocha-example) - gathers performance metrics via Lighthouse and tests them in Mocha
* [pwmetrics](https://github.com/paulirish/pwmetrics/) - gather performance metrics
* [pwmetrics](https://github.com/paulirish/pwmetrics/) - gather performance metrics
* [lighthouse-hue](https://github.com/ebidel/lighthouse-hue) - Lighthouse score setting the color of Philips Hue lights
* [lighthouse-batch](https://www.npmjs.com/package/lighthouse-batch) - Run Lighthouse over a number of sites in sequence and generating a summary report including all of their scores.

Expand Down Expand Up @@ -265,7 +265,7 @@ Better docs coming soon, but in the meantime look at [PR #593](https://github.co
### Custom configurations for runs

You can supply your own run configuration to customize what audits you want details on. Copy the [default.json](https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/config/default.json) and start customizing. Then provide to the CLI with `lighthouse --config-path=myconfig.json <url>`
You can supply your own run configuration to customize what audits you want details on. Copy the [default.js](https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/config/default.js) and start customizing. Then provide to the CLI with `lighthouse --config-path=myconfig.js <url>`

If you are simply adding additional audits/gatherers or tweaking flags, you can extend the default configuration without having to copy the default and maintain it. Passes with the same name will be merged together, all other arrays will be concatenated, and primitive values will override the defaults. See the example below that adds a custom gatherer to the default pass and an audit.

Expand Down

0 comments on commit 1708865

Please sign in to comment.