From 269c96d8d733a8fdf840703f5e5198b3a95efa9c Mon Sep 17 00:00:00 2001 From: Kohei Ueno Date: Fri, 15 Apr 2022 07:20:51 +0900 Subject: [PATCH] test: remove the legacy url parser function PR-URL: https://github.com/nodejs/node/pull/42656 Reviewed-By: Luigi Pinca Reviewed-By: Darshan Sen Reviewed-By: Akhil Marsonya Reviewed-By: James M Snell --- test/common/inspector-helper.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/common/inspector-helper.js b/test/common/inspector-helper.js index 0a47cb1d58981a..e8e2c2de5cd1ee 100644 --- a/test/common/inspector-helper.js +++ b/test/common/inspector-helper.js @@ -5,8 +5,7 @@ const fs = require('fs'); const http = require('http'); const fixtures = require('../common/fixtures'); const { spawn } = require('child_process'); -const { parse: parseURL } = require('url'); -const { pathToFileURL } = require('url'); +const { URL, pathToFileURL } = require('url'); const { EventEmitter } = require('events'); const _MAINSCRIPT = fixtures.path('loop.js'); @@ -417,7 +416,7 @@ class NodeInstance extends EventEmitter { const port = await this.portPromise; return http.get({ port, - path: parseURL(devtoolsUrl).path, + path: new URL(devtoolsUrl).pathname, headers: { 'Connection': 'Upgrade', 'Upgrade': 'websocket',