From 7517f978cc3827613be89cd6dffc2ba02e2e033b Mon Sep 17 00:00:00 2001 From: Kyle Farnung Date: Tue, 13 Jun 2017 16:31:16 -0700 Subject: [PATCH] test: fixing test breaks * refactor of parallel/test-domain removed the `const common` declaration * addition of inspector/test-inspector-exception required ChakraCore-specific logic PR-URL: https://github.com/nodejs/node-chakracore/pull/299 Reviewed-By: Hitesh Kanwathirtha --- test/inspector/test-inspector-exception.js | 24 +++++++++++++++------- test/parallel/test-domain.js | 2 +- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/test/inspector/test-inspector-exception.js b/test/inspector/test-inspector-exception.js index 3f470c94c18..6f75db2bbad 100644 --- a/test/inspector/test-inspector-exception.js +++ b/test/inspector/test-inspector-exception.js @@ -29,18 +29,28 @@ function testBreakpointOnStart(session) { { 'method': 'Debugger.setPauseOnExceptions', 'params': {'state': 'none'} }, { 'method': 'Debugger.setAsyncCallStackDepth', - 'params': {'maxDepth': 0} }, - { 'method': 'Profiler.enable' }, - { 'method': 'Profiler.setSamplingInterval', - 'params': {'interval': 100} }, + 'params': {'maxDepth': 0} } + ]; + + if (process.jsEngine !== 'chakracore') { + commands.push( + { 'method': 'Profiler.enable' }, + { 'method': 'Profiler.setSamplingInterval', + 'params': {'interval': 100} }); + } + + commands.push( { 'method': 'Debugger.setBlackboxPatterns', 'params': {'patterns': []} }, - { 'method': 'Runtime.runIfWaitingForDebugger' } - ]; + { 'method': 'Runtime.runIfWaitingForDebugger' }); + + // ChakraCore breaks on the first executable line rather than on the first + // line of the file. + const breakLine = common.isChakraEngine ? 21 : 0; session .sendInspectorCommands(commands) - .expectMessages(setupExpectBreakOnLine(0, script, session)); + .expectMessages(setupExpectBreakOnLine(breakLine, script, session)); } function testWaitsForFrontendDisconnect(session, harness) { diff --git a/test/parallel/test-domain.js b/test/parallel/test-domain.js index 1c1dee412d3..97ea6f92aa8 100644 --- a/test/parallel/test-domain.js +++ b/test/parallel/test-domain.js @@ -22,7 +22,7 @@ 'use strict'; // Simple tests of most basic domain functionality. -require('../common'); +const common = require('../common'); const assert = require('assert'); const domain = require('domain'); const events = require('events');