1'use strict'; 2const common = require('../common'); 3 4common.skipIfInspectorDisabled(); 5 6const startCLI = require('../common/debugger'); 7 8const assert = require('assert'); 9 10// Launch CLI w/o args. 11{ 12 const cli = startCLI([]); 13 cli.quit() 14 .then((code) => { 15 assert.strictEqual(code, 1); 16 assert.match(cli.output, /^Usage:/, 'Prints usage info'); 17 }); 18} 19 20// Launch w/ invalid host:port. 21{ 22 const cli = startCLI([`localhost:${common.PORT}`]); 23 cli.quit() 24 .then((code) => { 25 assert.match( 26 cli.output, 27 /failed to connect/, 28 'Tells the user that the connection failed'); 29 assert.strictEqual(code, 1); 30 }); 31} 32