be more explicit about setting the default option value to 'vm'

This commit is contained in:
Michael Bradley, Jr 2018-09-14 20:15:48 -05:00
parent ac930d0be0
commit f790ecdcbb

View File

@ -274,12 +274,13 @@ class Cmd {
.option('--loglevel [loglevel]', __('level of logging to display') + ' ["error", "warn", "info", "debug", "trace"]', /^(error|warn|info|debug|trace)$/i, 'warn') .option('--loglevel [loglevel]', __('level of logging to display') + ' ["error", "warn", "info", "debug", "trace"]', /^(error|warn|info|debug|trace)$/i, 'warn')
.description(__('run tests')) .description(__('run tests'))
.action(function(file, options) { .action(function(file, options) {
const node = options.node; const node = options.node || 'vm';
const urlRegexExp = /^(vm|embark|((ws|https?):\/\/([a-zA-Z0-9_.-]*):?([0-9]*)?))$/i; const urlRegexExp = /^(vm|embark|((ws|https?):\/\/([a-zA-Z0-9_.-]*):?([0-9]*)?))$/i;
if (node && !(node === 'embark' || node === 'vm' || node.match(urlRegexExp))) { if (node && !(node === 'embark' || node === 'vm' || node.match(urlRegexExp))) {
console.error(`invalid --node option: must be 'vm', 'embark' or a valid URL`.red); console.error(`invalid --node option: must be 'vm', 'embark' or a valid URL`.red);
process.exit(1); process.exit(1);
} }
options.node = node;
checkDeps(); checkDeps();
i18n.setOrDetectLocale(options.locale); i18n.setOrDetectLocale(options.locale);
embark.runTests({file, loglevel: options.loglevel, gasDetails: options.gasDetails, embark.runTests({file, loglevel: options.loglevel, gasDetails: options.gasDetails,