Skip to content

Commit 39c5f94

Browse files
Trotttargos
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 23ad927 commit 39c5f94

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎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
constcommon=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
constmainContextPromise=
2323
notificationPromise('Runtime.executionContextCreated');
2424

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

149149
asyncfunctiontestBreakpointHit(){
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
constpausedPromise=notificationPromise('Debugger.paused');
154154
runInNewContext('debugger',{});

0 commit comments

Comments
 (0)