Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adamraine committed Mar 21, 2024
1 parent e79fd27 commit 86a8d9a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 20 deletions.
22 changes: 11 additions & 11 deletions core/test/audits/uses-rel-preload-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe('Performance: uses-rel-preload audit', () => {
const artifacts = mockArtifacts(networkRecords, mainDocumentNodeUrl);
artifacts.URL.requestedUrl = rootNodeUrl;
const context = {settings: {}, computedCache: new Map()};
return UsesRelPreload.audit_(artifacts, context).then(
return UsesRelPreload.audit(artifacts, context).then(
output => {
assert.equal(output.details.overallSavingsMs, 330);
assert.equal(output.details.items.length, 2);
Expand All @@ -169,7 +169,7 @@ describe('Performance: uses-rel-preload audit', () => {

const artifacts = mockArtifacts(networkRecords, defaultMainResourceUrl);
const context = {settings: {}, computedCache: new Map()};
return UsesRelPreload.audit_(artifacts, context).then(output => {
return UsesRelPreload.audit(artifacts, context).then(output => {
assert.equal(output.details.overallSavingsMs, 314);
assert.equal(output.details.items.length, 1);
});
Expand Down Expand Up @@ -206,7 +206,7 @@ describe('Performance: uses-rel-preload audit', () => {

const artifacts = mockArtifacts(networkRecords, defaultMainResourceUrl);
const context = {settings: {}, computedCache: new Map()};
const result = await UsesRelPreload.audit_(artifacts, context);
const result = await UsesRelPreload.audit(artifacts, context);
expect(result.warnings).toHaveLength(1);
});

Expand Down Expand Up @@ -243,7 +243,7 @@ describe('Performance: uses-rel-preload audit', () => {

const artifacts = mockArtifacts(networkRecords, defaultMainResourceUrl);
const context = {settings: {}, computedCache: new Map()};
const result = await UsesRelPreload.audit_(artifacts, context);
const result = await UsesRelPreload.audit(artifacts, context);
expect(result.warnings).toBeUndefined();
});

Expand All @@ -258,7 +258,7 @@ describe('Performance: uses-rel-preload audit', () => {

const artifacts = mockArtifacts(networkRecords, defaultMainResourceUrl);
const context = {settings: {}, computedCache: new Map()};
const result = await UsesRelPreload.audit_(artifacts, context);
const result = await UsesRelPreload.audit(artifacts, context);
expect(result.warnings).toBeUndefined();
});

Expand All @@ -268,7 +268,7 @@ describe('Performance: uses-rel-preload audit', () => {

const artifacts = mockArtifacts(networkRecords, defaultMainResourceUrl);
const context = {settings: {}, computedCache: new Map()};
return UsesRelPreload.audit_(artifacts, context).then(output => {
return UsesRelPreload.audit(artifacts, context).then(output => {
assert.equal(output.score, 1);
assert.equal(output.details.overallSavingsMs, 0);
assert.equal(output.details.items.length, 0);
Expand All @@ -281,7 +281,7 @@ describe('Performance: uses-rel-preload audit', () => {

const artifacts = mockArtifacts(networkRecords, defaultMainResourceUrl);
const context = {settings: {}, computedCache: new Map()};
const result = await UsesRelPreload.audit_(artifacts, context);
const result = await UsesRelPreload.audit(artifacts, context);
expect(result).toMatchObject({score: 1, details: {overallSavingsMs: 0, items: []}});
});

Expand All @@ -291,7 +291,7 @@ describe('Performance: uses-rel-preload audit', () => {

const artifacts = mockArtifacts(networkRecords, defaultMainResourceUrl);
const context = {settings: {}, computedCache: new Map()};
return UsesRelPreload.audit_(artifacts, context).then(output => {
return UsesRelPreload.audit(artifacts, context).then(output => {
assert.equal(output.score, 1);
assert.equal(output.details.overallSavingsMs, 0);
assert.equal(output.details.items.length, 0);
Expand All @@ -304,7 +304,7 @@ describe('Performance: uses-rel-preload audit', () => {

const artifacts = mockArtifacts(networkRecords, defaultMainResourceUrl);
const context = {settings: {}, computedCache: new Map()};
return UsesRelPreload.audit_(artifacts, context).then(output => {
return UsesRelPreload.audit(artifacts, context).then(output => {
assert.equal(output.numericValue, 0);
assert.equal(output.details.items.length, 0);
});
Expand All @@ -316,7 +316,7 @@ describe('Performance: uses-rel-preload audit', () => {

const artifacts = mockArtifacts(networkRecords, defaultMainResourceUrl);
const context = {settings: {}, computedCache: new Map()};
return UsesRelPreload.audit_(artifacts, context).then(output => {
return UsesRelPreload.audit(artifacts, context).then(output => {
assert.equal(output.numericValue, 0);
assert.equal(output.details.items.length, 0);
});
Expand All @@ -335,7 +335,7 @@ describe('Performance: uses-rel-preload audit', () => {

const settings = {throttlingMethod: 'provided'};
const context = {settings, computedCache: new Map()};
const result = await UsesRelPreload.audit_(artifacts, context);
const result = await UsesRelPreload.audit(artifacts, context);
assert.equal(result.score, 1);
assert.equal(result.numericValue, 0);
});
Expand Down
4 changes: 0 additions & 4 deletions core/test/fixtures/user-flows/reports/sample-flow-result.json
Original file line number Diff line number Diff line change
Expand Up @@ -3847,7 +3847,6 @@
"critical-request-chains",
"uses-text-compression",
"uses-rel-preconnect",
"uses-rel-preload",
"font-display",
"unminified-javascript",
"unminified-css",
Expand All @@ -3866,7 +3865,6 @@
"critical-request-chains",
"uses-text-compression",
"uses-rel-preconnect",
"uses-rel-preload",
"font-display",
"unminified-javascript",
"unminified-css",
Expand Down Expand Up @@ -21891,7 +21889,6 @@
"critical-request-chains",
"uses-text-compression",
"uses-rel-preconnect",
"uses-rel-preload",
"font-display",
"unminified-javascript",
"unminified-css",
Expand All @@ -21910,7 +21907,6 @@
"critical-request-chains",
"uses-text-compression",
"uses-rel-preconnect",
"uses-rel-preload",
"font-display",
"unminified-javascript",
"unminified-css",
Expand Down
2 changes: 0 additions & 2 deletions core/test/results/sample_v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -6007,7 +6007,6 @@
"critical-request-chains",
"uses-text-compression",
"uses-rel-preconnect",
"uses-rel-preload",
"font-display",
"unminified-javascript",
"unminified-css",
Expand All @@ -6026,7 +6025,6 @@
"critical-request-chains",
"uses-text-compression",
"uses-rel-preconnect",
"uses-rel-preload",
"font-display",
"unminified-javascript",
"unminified-css",
Expand Down
4 changes: 2 additions & 2 deletions third-party/devtools-tests/e2e/lighthouse/navigation_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ describe('Navigation', function() {
});

const {auditResults, erroredAudits, failedAudits} = getAuditsBreakdown(lhr, ['max-potential-fid']);
assert.strictEqual(auditResults.length, 168);
assert.strictEqual(auditResults.length, 166);
assert.deepStrictEqual(erroredAudits, []);
assert.deepStrictEqual(failedAudits.map(audit => audit.id), [
'installable-manifest',
Expand Down Expand Up @@ -204,7 +204,7 @@ describe('Navigation', function() {
];

const {auditResults, erroredAudits, failedAudits} = getAuditsBreakdown(lhr, flakyAudits);
assert.strictEqual(auditResults.length, 168);
assert.strictEqual(auditResults.length, 166);
assert.deepStrictEqual(erroredAudits, []);
assert.deepStrictEqual(failedAudits.map(audit => audit.id), [
'installable-manifest',
Expand Down
2 changes: 1 addition & 1 deletion third-party/devtools-tests/e2e/lighthouse/timespan_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('Timespan', function() {
assert.strictEqual(devicePixelRatio, 1);

const {auditResults, erroredAudits, failedAudits} = getAuditsBreakdown(lhr);
assert.strictEqual(auditResults.length, 48);
assert.strictEqual(auditResults.length, 47);
assert.deepStrictEqual(erroredAudits, []);
assert.deepStrictEqual(failedAudits.map(audit => audit.id), []);

Expand Down

0 comments on commit 86a8d9a

Please sign in to comment.