From 275092be4b5ddb19f9ebbcf8a7b9e2dfefa8f712 Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Fri, 4 Jan 2019 11:59:43 -0800 Subject: [PATCH] tests(smokehouse): use native node URLSearchParams --- lighthouse-cli/test/fixtures/static-server.js | 2 +- lighthouse-cli/test/smokehouse/seo/expectations.js | 2 +- lighthouse-core/lib/url-shim.js | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lighthouse-cli/test/fixtures/static-server.js b/lighthouse-cli/test/fixtures/static-server.js index a92260768629..2e6604b5de3f 100644 --- a/lighthouse-cli/test/fixtures/static-server.js +++ b/lighthouse-cli/test/fixtures/static-server.js @@ -13,7 +13,7 @@ const path = require('path'); const fs = require('fs'); const parseQueryString = require('querystring').parse; const parseURL = require('url').parse; -const URLSearchParams = require('../../../lighthouse-core/lib/url-shim').URLSearchParams; +const URLSearchParams = require('url').URLSearchParams; const HEADER_SAFELIST = new Set(['x-robots-tag', 'link']); const lhRootDirPath = path.join(__dirname, '../../../'); diff --git a/lighthouse-cli/test/smokehouse/seo/expectations.js b/lighthouse-cli/test/smokehouse/seo/expectations.js index 7e36d3655433..1cdabbce5582 100644 --- a/lighthouse-cli/test/smokehouse/seo/expectations.js +++ b/lighthouse-cli/test/smokehouse/seo/expectations.js @@ -5,7 +5,7 @@ */ 'use strict'; const BASE_URL = 'http://localhost:10200/seo/'; -const URLSearchParams = require('../../../../lighthouse-core/lib/url-shim').URLSearchParams; +const URLSearchParams = require('url').URLSearchParams; function headersParam(headers) { const headerString = new URLSearchParams(headers).toString(); diff --git a/lighthouse-core/lib/url-shim.js b/lighthouse-core/lib/url-shim.js index 0bf06d2fa87e..a275bd88aca6 100644 --- a/lighthouse-core/lib/url-shim.js +++ b/lighthouse-core/lib/url-shim.js @@ -206,8 +206,6 @@ class URLShim extends URL { } URLShim.URL = URL; -URLShim.URLSearchParams = (typeof self !== 'undefined' && self.URLSearchParams) || - require('url').URLSearchParams; URLShim.NON_NETWORK_PROTOCOLS = ['blob', 'data', 'intent'];