From 17ac7e23bd70f1b98ddc79f9221ef2831e393119 Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Tue, 7 Jan 2020 13:31:23 -0800 Subject: [PATCH] tests: remove global.URL (#10186) --- .../test/report/html/renderer/category-renderer-test.js | 3 --- .../test/report/html/renderer/crc-details-renderer-test.js | 3 --- .../test/report/html/renderer/details-renderer-test.js | 3 --- lighthouse-core/test/report/html/renderer/dom-test.js | 3 --- .../report/html/renderer/performance-category-renderer-test.js | 2 -- lighthouse-core/test/report/html/renderer/psi-test.js | 3 --- .../test/report/html/renderer/pwa-category-renderer-test.js | 3 --- .../test/report/html/renderer/report-renderer-test.js | 2 -- 8 files changed, 22 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 2da0078153df..3bad2dd9e702 100644 --- a/lighthouse-core/test/report/html/renderer/category-renderer-test.js +++ b/lighthouse-core/test/report/html/renderer/category-renderer-test.js @@ -12,7 +12,6 @@ const fs = require('fs'); const jsdom = require('jsdom'); const Util = require('../../../../report/html/renderer/util.js'); const I18n = require('../../../../report/html/renderer/i18n.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( @@ -28,7 +27,6 @@ describe('CategoryRenderer', () => { let sampleResults; beforeAll(() => { - global.URL = URL; global.Util = Util; global.Util.i18n = new I18n('en', {...Util.UIStrings}); global.CriticalRequestChainRenderer = CriticalRequestChainRenderer; @@ -42,7 +40,6 @@ describe('CategoryRenderer', () => { }); afterAll(() => { - global.URL = undefined; global.Util.i18n = 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 3bad9dfcc0c7..a4b97e31301e 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 I18n = require('../../../../report/html/renderer/i18n.js'); const DOM = require('../../../../report/html/renderer/dom.js'); @@ -80,7 +79,6 @@ describe('DetailsRenderer', () => { let detailsRenderer; beforeAll(() => { - global.URL = URL; global.Util = Util; global.Util.i18n = new I18n('en', {...Util.UIStrings}); const {document} = new jsdom.JSDOM(TEMPLATE_FILE).window; @@ -89,7 +87,6 @@ describe('DetailsRenderer', () => { }); afterAll(() => { - global.URL = undefined; global.Util.i18n = 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 86b0d19708f2..2b38ec4b53eb 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 I18n = require('../../../../report/html/renderer/i18n.js'); @@ -25,7 +24,6 @@ describe('DetailsRenderer', () => { let renderer; beforeAll(() => { - global.URL = URL; global.Util = Util; global.Util.i18n = new I18n('en', {...Util.UIStrings}); global.CriticalRequestChainRenderer = CrcDetailsRenderer; @@ -37,7 +35,6 @@ describe('DetailsRenderer', () => { }); afterAll(() => { - global.URL = undefined; global.Util.i18n = undefined; global.Util = undefined; global.CriticalRequestChainRenderer = undefined; diff --git a/lighthouse-core/test/report/html/renderer/dom-test.js b/lighthouse-core/test/report/html/renderer/dom-test.js index a2eead0a6fb2..11fd9e78b348 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'); const I18n = require('../../../../report/html/renderer/i18n.js'); @@ -22,7 +21,6 @@ describe('DOM', () => { let dom; beforeAll(() => { - global.URL = URL; global.Util = Util; global.Util.i18n = new I18n('en', {...Util.UIStrings}); const {document} = new jsdom.JSDOM(TEMPLATE_FILE).window; @@ -31,7 +29,6 @@ describe('DOM', () => { }); afterAll(() => { - global.URL = undefined; global.Util.i18n = 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 120b2de41019..5a3c99e6c0e4 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 @@ -29,7 +29,6 @@ describe('PerfCategoryRenderer', () => { let sampleResults; beforeAll(() => { - global.URL = URL; global.Util = Util; global.Util.i18n = new I18n('en', {...Util.UIStrings}); global.CriticalRequestChainRenderer = CriticalRequestChainRenderer; @@ -49,7 +48,6 @@ describe('PerfCategoryRenderer', () => { }); afterAll(() => { - global.URL = undefined; global.Util.i18n = undefined; global.Util = undefined; global.CriticalRequestChainRenderer = undefined; diff --git a/lighthouse-core/test/report/html/renderer/psi-test.js b/lighthouse-core/test/report/html/renderer/psi-test.js index 3644d0cceeac..a1e152b3e885 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 I18n = require('../../../../report/html/renderer/i18n.js'); @@ -36,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.Util.i18n = new I18n('en', {...Util.UIStrings}); @@ -55,7 +53,6 @@ describe('DOM', () => { }); afterAll(() => { - global.URL = undefined; global.Util.i18n = undefined; global.Util = undefined; global.DOM = 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 57f655b906de..35a8f9fd3e2d 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 @@ -12,7 +12,6 @@ const fs = require('fs'); const jsdom = require('jsdom'); const Util = require('../../../../report/html/renderer/util.js'); const I18n = require('../../../../report/html/renderer/i18n.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'); @@ -27,7 +26,6 @@ describe('PwaCategoryRenderer', () => { let sampleResults; beforeAll(() => { - global.URL = URL; global.Util = Util; global.Util.i18n = new I18n('en', {...Util.UIStrings}); global.CategoryRenderer = CategoryRenderer; @@ -50,7 +48,6 @@ describe('PwaCategoryRenderer', () => { }); afterAll(() => { - global.URL = undefined; global.Util.i18n = 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 b5a109520a43..87db7bcabf41 100644 --- a/lighthouse-core/test/report/html/renderer/report-renderer-test.js +++ b/lighthouse-core/test/report/html/renderer/report-renderer-test.js @@ -31,7 +31,6 @@ describe('ReportRenderer', () => { let sampleResults; beforeAll(() => { - global.URL = URL; global.Util = Util; global.I18n = I18n; global.ReportUIFeatures = ReportUIFeatures; @@ -64,7 +63,6 @@ describe('ReportRenderer', () => { afterAll(() => { global.self = undefined; - global.URL = undefined; global.Util = undefined; global.I18n = undefined; global.ReportUIFeatures = undefined;