Skip to content
Permalink
Browse files

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>
  • Loading branch information
Trott authored and MylesBorins committed Nov 26, 2019
1 parent c3ad977 commit ece08a5821e426eabbb76b83066fd134f955cb07
Showing with 3 additions and 3 deletions.
  1. +3 −3 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', {});

0 comments on commit ece08a5

Please sign in to comment.
You can’t perform that action at this time.