summaryrefslogtreecommitdiff
path: root/test/parallel/test-debug-usage.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2016-08-10 16:47:20 -0700
committerRich Trott <rtrott@gmail.com>2016-08-12 17:15:40 -0700
commit3dfcb2e266d5e66610de077c25adc93fd552c267 (patch)
tree18bed363539e7706920b103ea124d731c7e6f853 /test/parallel/test-debug-usage.js
parentca6363b8aee1cf65a9b5674c9f8583bfb5fedf4b (diff)
downloadandroid-node-v8-3dfcb2e266d5e66610de077c25adc93fd552c267.tar.gz
android-node-v8-3dfcb2e266d5e66610de077c25adc93fd552c267.tar.bz2
android-node-v8-3dfcb2e266d5e66610de077c25adc93fd552c267.zip
test: add test for debug usage message
PR-URL: https://github.com/nodejs/node/pull/8061 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: cjihrig - Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-debug-usage.js')
-rw-r--r--test/parallel/test-debug-usage.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/parallel/test-debug-usage.js b/test/parallel/test-debug-usage.js
new file mode 100644
index 0000000000..5406a82cc8
--- /dev/null
+++ b/test/parallel/test-debug-usage.js
@@ -0,0 +1,21 @@
+'use strict';
+const common = require('../common');
+const assert = require('assert');
+const spawn = require('child_process').spawn;
+
+const child = spawn(process.execPath, ['debug']);
+child.stderr.setEncoding('utf8');
+
+const expectedUsageMessage = `Usage: node debug script.js
+ node debug <host>:<port>
+ node debug -p <pid>
+`;
+var actualUsageMessage = '';
+child.stderr.on('data', function(data) {
+ actualUsageMessage += data.toString();
+});
+
+child.on('exit', common.mustCall(function(code) {
+ assert.strictEqual(code, 1);
+ assert.strictEqual(actualUsageMessage, expectedUsageMessage);
+}));