Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 19abee1

Browse filesBrowse files
apapirovskiMylesBorins
authored andcommitted
test: fix a bug & lint issues in inspector-helper
PR-URL: #18293 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com>
1 parent 74051c6 commit 19abee1
Copy full SHA for 19abee1

File tree

Expand file treeCollapse file tree

1 file changed

+7
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-5
lines changed
Open diff view settings
Collapse file

‎test/common/inspector-helper.js‎

Copy file name to clipboardExpand all lines: test/common/inspector-helper.js
+7-5Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ const fs = require('fs');
55
const http = require('http');
66
const fixtures = require('../common/fixtures');
77
const { spawn } = require('child_process');
8-
const { URL, parse: parseURL } = require('url');
8+
const { parse: parseURL } = require('url');
99
const { getURLFromFilePath } = require('internal/url');
10-
const path = require('path');
1110

1211
const _MAINSCRIPT = fixtures.path('loop.js');
1312
const DEBUG = false;
@@ -173,7 +172,9 @@ class InspectorSession {
173172
const scriptId = script['scriptId'];
174173
const url = script['url'];
175174
this._scriptsIdsByUrl.set(scriptId, url);
176-
if (getURLFromFilePath(url).toString() === this.scriptURL().toString()) {
175+
const fileUrl = url.startsWith('file:') ?
176+
url : getURLFromFilePath(url).toString();
177+
if (fileUrl === this.scriptURL().toString()) {
177178
this.mainScriptId = scriptId;
178179
}
179180
}
@@ -246,8 +247,9 @@ class InspectorSession {
246247
const callFrame = message['params']['callFrames'][0];
247248
const location = callFrame['location'];
248249
const scriptPath = this._scriptsIdsByUrl.get(location['scriptId']);
249-
assert(scriptPath.toString() === expectedScriptPath.toString(),
250-
`${scriptPath} !== ${expectedScriptPath}`);
250+
assert.strictEqual(scriptPath.toString(),
251+
expectedScriptPath.toString(),
252+
`${scriptPath} !== ${expectedScriptPath}`);
251253
assert.strictEqual(line, location['lineNumber']);
252254
return true;
253255
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.