Skip to content

Commit 39c5f94

Browse files
Trotttargos
authored andcommittedDec 1, 2019
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 <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 23ad927 commit 39c5f94

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎test/sequential/test-inspector-contexts.js

+3-3
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)