From 2610595b7ed398066d09752c4c9975113f4894e1 Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Tue, 7 Jan 2020 12:23:32 -0800 Subject: [PATCH 1/3] tests: remove global.URL --- .../test/report/html/renderer/category-renderer-test.js | 2 -- .../test/report/html/renderer/crc-details-renderer-test.js | 2 -- .../test/report/html/renderer/details-renderer-test.js | 2 -- lighthouse-core/test/report/html/renderer/dom-test.js | 2 -- .../report/html/renderer/performance-category-renderer-test.js | 2 -- lighthouse-core/test/report/html/renderer/psi-test.js | 2 -- .../test/report/html/renderer/pwa-category-renderer-test.js | 2 -- .../test/report/html/renderer/report-renderer-test.js | 2 -- 8 files changed, 16 deletions(-) diff --git a/lighthouse-core/test/report/html/renderer/category-renderer-test.js b/lighthouse-core/test/report/html/renderer/category-renderer-test.js index b46136484d82..8c9384e4ec5a 100644 --- a/lighthouse-core/test/report/html/renderer/category-renderer-test.js +++ b/lighthouse-core/test/report/html/renderer/category-renderer-test.js @@ -27,7 +27,6 @@ describe('CategoryRenderer', () => { let sampleResults; beforeAll(() => { - global.URL = URL; global.Util = Util; global.CriticalRequestChainRenderer = CriticalRequestChainRenderer; @@ -40,7 +39,6 @@ describe('CategoryRenderer', () => { }); afterAll(() => { - global.URL = undefined; global.Util = undefined; global.CriticalRequestChainRenderer = undefined; }); diff --git a/lighthouse-core/test/report/html/renderer/crc-details-renderer-test.js b/lighthouse-core/test/report/html/renderer/crc-details-renderer-test.js index f5d8ca14ce6a..05b344cc4e88 100644 --- a/lighthouse-core/test/report/html/renderer/crc-details-renderer-test.js +++ b/lighthouse-core/test/report/html/renderer/crc-details-renderer-test.js @@ -79,7 +79,6 @@ describe('DetailsRenderer', () => { let detailsRenderer; beforeAll(() => { - global.URL = URL; global.Util = Util; const {document} = new jsdom.JSDOM(TEMPLATE_FILE).window; dom = new DOM(document); @@ -87,7 +86,6 @@ describe('DetailsRenderer', () => { }); afterAll(() => { - global.URL = undefined; global.Util = undefined; }); diff --git a/lighthouse-core/test/report/html/renderer/details-renderer-test.js b/lighthouse-core/test/report/html/renderer/details-renderer-test.js index 0b4193ebd945..df2b1b182cde 100644 --- a/lighthouse-core/test/report/html/renderer/details-renderer-test.js +++ b/lighthouse-core/test/report/html/renderer/details-renderer-test.js @@ -24,7 +24,6 @@ describe('DetailsRenderer', () => { let renderer; beforeAll(() => { - global.URL = URL; global.Util = Util; global.CriticalRequestChainRenderer = CrcDetailsRenderer; global.SnippetRenderer = SnippetRenderer; @@ -35,7 +34,6 @@ describe('DetailsRenderer', () => { }); afterAll(() => { - global.URL = undefined; global.Util = undefined; global.CriticalRequestChainRenderer = undefined; global.SnippetRenderer = undefined; diff --git a/lighthouse-core/test/report/html/renderer/dom-test.js b/lighthouse-core/test/report/html/renderer/dom-test.js index 63fc457c39be..a219f0bab333 100644 --- a/lighthouse-core/test/report/html/renderer/dom-test.js +++ b/lighthouse-core/test/report/html/renderer/dom-test.js @@ -21,7 +21,6 @@ describe('DOM', () => { let dom; beforeAll(() => { - global.URL = URL; global.Util = Util; const {document} = new jsdom.JSDOM(TEMPLATE_FILE).window; dom = new DOM(document); @@ -29,7 +28,6 @@ describe('DOM', () => { }); afterAll(() => { - global.URL = undefined; global.Util = undefined; }); diff --git a/lighthouse-core/test/report/html/renderer/performance-category-renderer-test.js b/lighthouse-core/test/report/html/renderer/performance-category-renderer-test.js index 7078d1e6cb67..70f067f6c592 100644 --- a/lighthouse-core/test/report/html/renderer/performance-category-renderer-test.js +++ b/lighthouse-core/test/report/html/renderer/performance-category-renderer-test.js @@ -28,7 +28,6 @@ describe('PerfCategoryRenderer', () => { let sampleResults; beforeAll(() => { - global.URL = URL; global.Util = Util; global.CriticalRequestChainRenderer = CriticalRequestChainRenderer; global.CategoryRenderer = CategoryRenderer; @@ -47,7 +46,6 @@ describe('PerfCategoryRenderer', () => { }); afterAll(() => { - global.URL = undefined; global.Util = undefined; global.CriticalRequestChainRenderer = undefined; global.CategoryRenderer = undefined; diff --git a/lighthouse-core/test/report/html/renderer/psi-test.js b/lighthouse-core/test/report/html/renderer/psi-test.js index b09f7c5c5077..f0218e7b66d2 100644 --- a/lighthouse-core/test/report/html/renderer/psi-test.js +++ b/lighthouse-core/test/report/html/renderer/psi-test.js @@ -35,7 +35,6 @@ const TEMPLATE_FILE = fs.readFileSync( describe('DOM', () => { let document; beforeAll(() => { - global.URL = URL; // COMPAT: Needed for Node < 10 global.Util = Util; global.DOM = DOM; global.CategoryRenderer = CategoryRenderer; @@ -52,7 +51,6 @@ describe('DOM', () => { }); afterAll(() => { - global.URL = undefined; global.Util = undefined; global.DOM = undefined; global.CategoryRenderer = undefined; diff --git a/lighthouse-core/test/report/html/renderer/pwa-category-renderer-test.js b/lighthouse-core/test/report/html/renderer/pwa-category-renderer-test.js index e71a81f5d1ad..612ff7197aa4 100644 --- a/lighthouse-core/test/report/html/renderer/pwa-category-renderer-test.js +++ b/lighthouse-core/test/report/html/renderer/pwa-category-renderer-test.js @@ -26,7 +26,6 @@ describe('PwaCategoryRenderer', () => { let sampleResults; beforeAll(() => { - global.URL = URL; global.Util = Util; global.CategoryRenderer = CategoryRenderer; @@ -48,7 +47,6 @@ describe('PwaCategoryRenderer', () => { }); afterAll(() => { - global.URL = undefined; global.Util = undefined; global.CategoryRenderer = undefined; }); diff --git a/lighthouse-core/test/report/html/renderer/report-renderer-test.js b/lighthouse-core/test/report/html/renderer/report-renderer-test.js index 821e65aa4c03..ea78411808fd 100644 --- a/lighthouse-core/test/report/html/renderer/report-renderer-test.js +++ b/lighthouse-core/test/report/html/renderer/report-renderer-test.js @@ -30,7 +30,6 @@ describe('ReportRenderer', () => { let sampleResults; beforeAll(() => { - global.URL = URL; global.Util = Util; global.ReportUIFeatures = ReportUIFeatures; global.CriticalRequestChainRenderer = CriticalRequestChainRenderer; @@ -62,7 +61,6 @@ describe('ReportRenderer', () => { afterAll(() => { global.self = undefined; - global.URL = undefined; global.Util = undefined; global.ReportUIFeatures = undefined; global.matchMedia = undefined; From 99e84b92890dcfee0b5fc0d02f80519eda03f27a Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Tue, 7 Jan 2020 12:26:04 -0800 Subject: [PATCH 2/3] less --- .../test/report/html/renderer/crc-details-renderer-test.js | 1 - .../test/report/html/renderer/details-renderer-test.js | 1 - lighthouse-core/test/report/html/renderer/dom-test.js | 1 - lighthouse-core/test/report/html/renderer/psi-test.js | 1 - .../test/report/html/renderer/pwa-category-renderer-test.js | 1 - 5 files changed, 5 deletions(-) diff --git a/lighthouse-core/test/report/html/renderer/crc-details-renderer-test.js b/lighthouse-core/test/report/html/renderer/crc-details-renderer-test.js index 05b344cc4e88..581982f8c779 100644 --- a/lighthouse-core/test/report/html/renderer/crc-details-renderer-test.js +++ b/lighthouse-core/test/report/html/renderer/crc-details-renderer-test.js @@ -10,7 +10,6 @@ const assert = require('assert'); const fs = require('fs'); const jsdom = require('jsdom'); -const URL = require('../../../../lib/url-shim.js'); const Util = require('../../../../report/html/renderer/util.js'); const DOM = require('../../../../report/html/renderer/dom.js'); const DetailsRenderer = require('../../../../report/html/renderer/details-renderer.js'); diff --git a/lighthouse-core/test/report/html/renderer/details-renderer-test.js b/lighthouse-core/test/report/html/renderer/details-renderer-test.js index df2b1b182cde..34124003da78 100644 --- a/lighthouse-core/test/report/html/renderer/details-renderer-test.js +++ b/lighthouse-core/test/report/html/renderer/details-renderer-test.js @@ -8,7 +8,6 @@ const assert = require('assert'); const fs = require('fs'); const jsdom = require('jsdom'); -const URL = require('../../../../lib/url-shim.js'); const DOM = require('../../../../report/html/renderer/dom.js'); const Util = require('../../../../report/html/renderer/util.js'); const DetailsRenderer = require('../../../../report/html/renderer/details-renderer.js'); diff --git a/lighthouse-core/test/report/html/renderer/dom-test.js b/lighthouse-core/test/report/html/renderer/dom-test.js index a219f0bab333..c19d1f00a488 100644 --- a/lighthouse-core/test/report/html/renderer/dom-test.js +++ b/lighthouse-core/test/report/html/renderer/dom-test.js @@ -8,7 +8,6 @@ const assert = require('assert'); const fs = require('fs'); const jsdom = require('jsdom'); -const URL = require('../../../../lib/url-shim.js'); const DOM = require('../../../../report/html/renderer/dom.js'); const Util = require('../../../../report/html/renderer/util.js'); diff --git a/lighthouse-core/test/report/html/renderer/psi-test.js b/lighthouse-core/test/report/html/renderer/psi-test.js index f0218e7b66d2..eccffcfaa00f 100644 --- a/lighthouse-core/test/report/html/renderer/psi-test.js +++ b/lighthouse-core/test/report/html/renderer/psi-test.js @@ -10,7 +10,6 @@ const fs = require('fs'); const jsdom = require('jsdom'); -const URL = require('../../../../lib/url-shim.js'); const prepareLabData = require('../../../../report/html/renderer/psi.js'); const Util = require('../../../../report/html/renderer/util.js'); const DOM = require('../../../../report/html/renderer/dom.js'); diff --git a/lighthouse-core/test/report/html/renderer/pwa-category-renderer-test.js b/lighthouse-core/test/report/html/renderer/pwa-category-renderer-test.js index 612ff7197aa4..1fc929830f44 100644 --- a/lighthouse-core/test/report/html/renderer/pwa-category-renderer-test.js +++ b/lighthouse-core/test/report/html/renderer/pwa-category-renderer-test.js @@ -11,7 +11,6 @@ const assert = require('assert'); const fs = require('fs'); const jsdom = require('jsdom'); const Util = require('../../../../report/html/renderer/util.js'); -const URL = require('../../../../lib/url-shim.js'); const DOM = require('../../../../report/html/renderer/dom.js'); const DetailsRenderer = require('../../../../report/html/renderer/details-renderer.js'); const CategoryRenderer = require('../../../../report/html/renderer/category-renderer.js'); From 024b65c5f555dadd0208373a0b350192057815fd Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Tue, 7 Jan 2020 12:34:06 -0800 Subject: [PATCH 3/3] lint --- .../test/report/html/renderer/category-renderer-test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lighthouse-core/test/report/html/renderer/category-renderer-test.js b/lighthouse-core/test/report/html/renderer/category-renderer-test.js index 8c9384e4ec5a..d7cf5524b87d 100644 --- a/lighthouse-core/test/report/html/renderer/category-renderer-test.js +++ b/lighthouse-core/test/report/html/renderer/category-renderer-test.js @@ -11,7 +11,6 @@ const assert = require('assert'); const fs = require('fs'); const jsdom = require('jsdom'); const Util = require('../../../../report/html/renderer/util.js'); -const URL = require('../../../../lib/url-shim.js'); const DOM = require('../../../../report/html/renderer/dom.js'); const DetailsRenderer = require('../../../../report/html/renderer/details-renderer.js'); const CriticalRequestChainRenderer = require(