Skip to content

Commit

Permalink
report: make red/orange/green score color thresholds tougher (#5831)
Browse files Browse the repository at this point in the history
  • Loading branch information
brendankenny authored Aug 14, 2018
1 parent bb44a7d commit 85e6ba9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lighthouse-core/report/html/renderer/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@

const ELLIPSIS = '\u2026';
const NBSP = '\xa0';
const PASS_THRESHOLD = 0.75;
const PASS_THRESHOLD = 0.9;

const RATINGS = {
PASS: {label: 'pass', minScore: PASS_THRESHOLD},
AVERAGE: {label: 'average', minScore: 0.45},
AVERAGE: {label: 'average', minScore: 0.5},
FAIL: {label: 'fail'},
ERROR: {label: 'error'},
};
Expand Down
9 changes: 5 additions & 4 deletions lighthouse-core/test/report/html/renderer/util-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ describe('util helpers', () => {
it('calculates a score ratings', () => {
assert.equal(Util.calculateRating(0.0), 'fail');
assert.equal(Util.calculateRating(0.10), 'fail');
assert.equal(Util.calculateRating(0.45), 'average');
assert.equal(Util.calculateRating(0.55), 'average');
assert.equal(Util.calculateRating(0.75), 'pass');
assert.equal(Util.calculateRating(0.80), 'pass');
assert.equal(Util.calculateRating(0.45), 'fail');
assert.equal(Util.calculateRating(0.5), 'average');
assert.equal(Util.calculateRating(0.75), 'average');
assert.equal(Util.calculateRating(0.80), 'average');
assert.equal(Util.calculateRating(0.90), 'pass');
assert.equal(Util.calculateRating(1.00), 'pass');
});

Expand Down

0 comments on commit 85e6ba9

Please sign in to comment.