Skip to content

Commit

Permalink
test: check for session.post() errors in test-insepctor-context
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Trott authored and targos committed Dec 1, 2019
1 parent 23ad927 commit 39c5f94
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/sequential/test-inspector-contexts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand All @@ -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) {
Expand Down Expand Up @@ -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', {});
Expand Down

0 comments on commit 39c5f94

Please sign in to comment.