Skip to content

Commit ece08a5

Browse files
TrottMylesBorins
authored andcommitted
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: #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>
1 parent c3ad977 commit ece08a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/sequential/test-inspector-contexts.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
const common = require('../common');
66
common.skipIfInspectorDisabled();
77

8-
const { strictEqual } = require('assert');
8+
const { ifError, strictEqual } = require('assert');
99
const { createContext, runInNewContext } = require('vm');
1010
const { Session } = require('inspector');
1111

@@ -22,7 +22,7 @@ async function testContextCreatedAndDestroyed() {
2222
const mainContextPromise =
2323
notificationPromise('Runtime.executionContextCreated');
2424

25-
session.post('Runtime.enable');
25+
session.post('Runtime.enable', assert.ifError);
2626
const contextCreated = await mainContextPromise;
2727
const { name, origin, auxData } = contextCreated.params.context;
2828
if (common.isSunOS || common.isWindows) {
@@ -148,7 +148,7 @@ async function testContextCreatedAndDestroyed() {
148148

149149
async function testBreakpointHit() {
150150
console.log('Testing breakpoint is hit in a new context');
151-
session.post('Debugger.enable');
151+
session.post('Debugger.enable', assert.ifError);
152152

153153
const pausedPromise = notificationPromise('Debugger.paused');
154154
runInNewContext('debugger', {});

0 commit comments

Comments
 (0)