Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
adamraine committed Jun 16, 2023
1 parent c2bd4fe commit f97bf07
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/test/audits/byte-efficiency/byte-efficiency-audit-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ describe('Byte efficiency base audit', () => {
],
}, simulator, metricComputationInput, {computedCache: new Map()});

expect(result.metricSavings.FCP).toEqual(900);
expect(result.metricSavings.LCP).toBeCloseTo(2384.2, 0.1);
assert.equal(result.metricSavings.FCP, 900);
assert.equal(result.metricSavings.LCP, 2380);
});

it('should score the wastedMs', async () => {
Expand Down Expand Up @@ -206,7 +206,7 @@ describe('Byte efficiency base audit', () => {
metricComputationInput.gatherContext.gatherMode = 'timespan';
const negativeResult = await ByteEfficiencyAudit.createAuditProduct({
headings: baseHeadings,
items: [{url: 'http://example.com/', wastedBytes: -1 * 1000}],
items: [{url: 'http://example.com/', wastedBytes: -1 * 10000}],
}, simulator, metricComputationInput, {computedCache: new Map()});

assert.equal(negativeResult.score, 1);
Expand Down Expand Up @@ -397,7 +397,7 @@ describe('Byte efficiency base audit', () => {
const modestThrottling = {rttMs: 150, throughputKbps: 1000, cpuSlowdownMultiplier: 2};
const settings = {throttlingMethod: 'simulate', throttling: modestThrottling};
const result = await MockAudit.audit(artifacts, {settings, computedCache});
expect(result.details.overallSavingsMs).toBeCloseTo(2118.99);
expect(result.details.overallSavingsMs).toEqual(2120);
});

it('should return n/a if no network records in timespan mode', async () => {
Expand Down Expand Up @@ -454,7 +454,7 @@ describe('Byte efficiency base audit', () => {
};
const settings = {throttlingMethod: 'devtools', throttling: modestThrottling};
const result = await MockAudit.audit(artifacts, {settings, computedCache});
expect(result.details.overallSavingsMs).toBeCloseTo(26, 1);
expect(result.details.overallSavingsMs).toEqual(30);
});

describe('#scoreForWastedMs', () => {
Expand Down

0 comments on commit f97bf07

Please sign in to comment.