1'use strict'; 2const common = require('../common'); 3 4common.skipIfInspectorDisabled(); 5 6const fixtures = require('../common/fixtures'); 7const startCLI = require('../common/debugger'); 8 9const assert = require('assert'); 10const path = require('path'); 11 12// Display and navigate backtrace. 13{ 14 const scriptFullPath = fixtures.path('debugger', 'backtrace.js'); 15 const script = path.relative(process.cwd(), scriptFullPath); 16 const cli = startCLI(['--port=0', script]); 17 18 async function runTest() { 19 try { 20 await cli.waitForInitialBreak(); 21 await cli.waitForPrompt(); 22 await cli.stepCommand('c'); 23 await cli.command('bt'); 24 assert.ok(cli.output.includes(`#0 topFn ${script}:7:2`)); 25 await cli.command('backtrace'); 26 assert.ok(cli.output.includes(`#0 topFn ${script}:7:2`)); 27 } finally { 28 await cli.quit(); 29 } 30 } 31 32 runTest(); 33} 34