summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnatoli Papirovski <apapirovski@mac.com>2018-01-22 12:12:38 -0500
committerAnatoli Papirovski <apapirovski@mac.com>2018-01-22 13:23:11 -0500
commita3555d0583452bec05e339bf2872cbb4e38236c9 (patch)
tree03cedecef1959a10ca792b0f97eccbd0fef7bf52 /test
parente7ff00d0c52ad7deefe8be4a6a293d15fd3fca7b (diff)
downloadandroid-node-v8-a3555d0583452bec05e339bf2872cbb4e38236c9.tar.gz
android-node-v8-a3555d0583452bec05e339bf2872cbb4e38236c9.tar.bz2
android-node-v8-a3555d0583452bec05e339bf2872cbb4e38236c9.zip
test: fix a bug & lint issues in inspector-helper
PR-URL: https://github.com/nodejs/node/pull/18293 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/common/inspector-helper.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/common/inspector-helper.js b/test/common/inspector-helper.js
index 5e927f2150..52e9d01b87 100644
--- a/test/common/inspector-helper.js
+++ b/test/common/inspector-helper.js
@@ -5,9 +5,8 @@ const fs = require('fs');
const http = require('http');
const fixtures = require('../common/fixtures');
const { spawn } = require('child_process');
-const { URL, parse: parseURL } = require('url');
+const { parse: parseURL } = require('url');
const { getURLFromFilePath } = require('internal/url');
-const path = require('path');
const _MAINSCRIPT = fixtures.path('loop.js');
const DEBUG = false;
@@ -173,7 +172,9 @@ class InspectorSession {
const scriptId = script['scriptId'];
const url = script['url'];
this._scriptsIdsByUrl.set(scriptId, url);
- if (getURLFromFilePath(url).toString() === this.scriptURL().toString()) {
+ const fileUrl = url.startsWith('file:') ?
+ url : getURLFromFilePath(url).toString();
+ if (fileUrl === this.scriptURL().toString()) {
this.mainScriptId = scriptId;
}
}
@@ -246,8 +247,9 @@ class InspectorSession {
const callFrame = message['params']['callFrames'][0];
const location = callFrame['location'];
const scriptPath = this._scriptsIdsByUrl.get(location['scriptId']);
- assert(scriptPath.toString() === expectedScriptPath.toString(),
- `${scriptPath} !== ${expectedScriptPath}`);
+ assert.strictEqual(scriptPath.toString(),
+ expectedScriptPath.toString(),
+ `${scriptPath} !== ${expectedScriptPath}`);
assert.strictEqual(line, location['lineNumber']);
return true;
}