node/test/parallel/test-cli-debug.js
Evan Lucas c0e7bf2d8c src: add getopt option parser
Options have been moved into the NodeOptions class.
A new global, node_options now exists and is used
to access the options after the command line arguments
have been parsed.

PR-URL: https://github.com/nodejs/io.js/pull/1804
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-06-01 08:39:06 -05:00

21 lines
577 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
const execFile = require('child_process').execFile;
const EOL = require('os').EOL;
var depmod = require.resolve('../fixtures/printA.js');
var node = process.execPath;
var debug = ['--debug', depmod];
var debugPort = ['--debug=5859', depmod];
function handle(port) {
return function(er, stdout, stderr) {
assert.equal(er, null);
assert.equal(stderr, `Debugger listening on port ${port}${EOL}`);
};
}
execFile(node, debug, handle(5858));
execFile(node, debugPort, handle(5859));