diff options
author | Rich Trott <rtrott@gmail.com> | 2019-11-25 22:22:54 -0800 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-11-27 22:39:48 -0800 |
commit | 4325ca6829bde9f9f48be2bd84b102838c38d310 (patch) | |
tree | ee140f321406d38bc3600246898ace70c0ce91ae /test/sequential/test-inspector-contexts.js | |
parent | 80c170e66fcdbb0ead33cee28129b16a30b33afd (diff) | |
download | android-node-v8-4325ca6829bde9f9f48be2bd84b102838c38d310.tar.gz android-node-v8-4325ca6829bde9f9f48be2bd84b102838c38d310.tar.bz2 android-node-v8-4325ca6829bde9f9f48be2bd84b102838c38d310.zip |
test: check for session.post() errors in test-insepctor-context
If session.post() generates an error, it is currently ignored. Add check
for error by adding a callback to session.post() invocation.
PR-URL: https://github.com/nodejs/node/pull/30649
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'test/sequential/test-inspector-contexts.js')
-rw-r--r-- | test/sequential/test-inspector-contexts.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/sequential/test-inspector-contexts.js b/test/sequential/test-inspector-contexts.js index 822b21f3ea..2307caa572 100644 --- a/test/sequential/test-inspector-contexts.js +++ b/test/sequential/test-inspector-contexts.js @@ -5,7 +5,7 @@ const common = require('../common'); common.skipIfInspectorDisabled(); -const { strictEqual } = require('assert'); +const { ifError, strictEqual } = require('assert'); const { createContext, runInNewContext } = require('vm'); const { Session } = require('inspector'); @@ -22,7 +22,7 @@ async function testContextCreatedAndDestroyed() { const mainContextPromise = notificationPromise('Runtime.executionContextCreated'); - session.post('Runtime.enable'); + session.post('Runtime.enable', assert.ifError); const contextCreated = await mainContextPromise; const { name, origin, auxData } = contextCreated.params.context; if (common.isSunOS || common.isWindows) { @@ -148,7 +148,7 @@ async function testContextCreatedAndDestroyed() { async function testBreakpointHit() { console.log('Testing breakpoint is hit in a new context'); - session.post('Debugger.enable'); + session.post('Debugger.enable', assert.ifError); const pausedPromise = notificationPromise('Debugger.paused'); runInNewContext('debugger', {}); |