1'use strict'; 2const common = require('../common'); 3 4common.skipIfInspectorDisabled(); 5 6const fixtures = require('../common/fixtures'); 7const startCLI = require('../common/debugger'); 8const { addLibraryPath } = require('../common/shared-lib-util'); 9 10const assert = require('assert'); 11const path = require('path'); 12 13addLibraryPath(process.env); 14 15// Auto-resume on start if the environment variable is defined. 16{ 17 const scriptFullPath = fixtures.path('debugger', 'break.js'); 18 const script = path.relative(process.cwd(), scriptFullPath); 19 20 const env = { ...process.env }; 21 env.NODE_INSPECT_RESUME_ON_START = '1'; 22 23 const cli = startCLI([script], [], { env }); 24 25 cli.waitForInitialBreak() 26 .then(() => { 27 assert.deepStrictEqual( 28 cli.breakInfo, 29 { filename: script, line: 10 }, 30 ); 31 }) 32 .then(() => cli.quit()) 33 .then((code) => { 34 assert.strictEqual(code, 0); 35 }); 36} 37