test.command.executableSubcommand.js
This file
Path
test/test.command.executableSubcommand.js
20 lines · 461 bytes · JavaScript
Last changed by
Merge pull request #324 from zhiyelee/ttZhiye Libefore adoption2051ab0
History of this fileTake it
123456789101112131415161718192021var program = require('../') , util = require('util') , should = require('should');
var oldError = console.error;var err = '';console.error = function (tpl, s) { err = util.format(tpl, s);};program .command('exec [options]', 'this is my command');
program.parse('node test exec a'.split(' '));
program.runningCommand.on('error', function() { err.should.equal('\n test-exec(1) does not exist, try --help\n');});
// @todo test `EACCES` error