diff --git a/cli/test/smokehouse/test-definitions/redirects-single-server.js b/cli/test/smokehouse/test-definitions/redirects-single-server.js index d5906ef4b763..19b96ceefe4c 100644 --- a/cli/test/smokehouse/test-definitions/redirects-single-server.js +++ b/cli/test/smokehouse/test-definitions/redirects-single-server.js @@ -45,7 +45,7 @@ const expectations = { numericValue: '>=2000', }, 'redirects': { - score: 1, + score: 0.29, numericValue: '>=2000', details: { items: [ diff --git a/core/audits/redirects.js b/core/audits/redirects.js index 7057954658f0..b3f230df7f41 100644 --- a/core/audits/redirects.js +++ b/core/audits/redirects.js @@ -144,10 +144,7 @@ class Redirects extends Audit { {overallSavingsMs: totalWastedMs}); return { - // We award a passing grade if you only have 1 redirect - // TODO(phulce): reconsider if cases like the example in https://github.com/GoogleChrome/lighthouse/issues/8984 - // should fail this audit. - score: documentRequests.length <= 2 ? 1 : ByteEfficiencyAudit.scoreForWastedMs(totalWastedMs), + score: ByteEfficiencyAudit.scoreForWastedMs(totalWastedMs), numericValue: totalWastedMs, numericUnit: 'millisecond', displayValue: totalWastedMs ? diff --git a/core/test/audits/redirects-test.js b/core/test/audits/redirects-test.js index 374b425b92fd..b6e40745a6c4 100644 --- a/core/test/audits/redirects-test.js +++ b/core/test/audits/redirects-test.js @@ -218,14 +218,12 @@ describe('Performance: Redirects audit', () => { }); }); - it('passes when one redirect detected', () => { + it('fails when 1 redirect detected', () => { const artifacts = mockArtifacts(SUCCESS_ONE_REDIRECT, 'https://www.lisairish.com/'); const context = {settings: {}, computedCache: new Map()}; return RedirectsAudit.audit(artifacts, context).then(output => { - // If === 1 redirect, perfect score is expected, regardless of latency - // We will still generate a table and show wasted time expect(output.details.items).toHaveLength(2); - expect(output.score).toEqual(1); + expect(output.score).toEqual(0.48); expect(output.numericValue).toMatchInlineSnapshot(`1000`); expect(output.metricSavings).toEqual({LCP: 1000, FCP: 1000}); });