From 3571e132a794d346980ba7696fc9e186abb51e1c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 25 Nov 2019 22:22:54 -0800 Subject: [PATCH] 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 Reviewed-By: Anto Aravinth Reviewed-By: Denys Otrishko Reviewed-By: Luigi Pinca --- test/sequential/test-inspector-contexts.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/sequential/test-inspector-contexts.js b/test/sequential/test-inspector-contexts.js index 822b21f3eac841..2307caa572bd55 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', {});