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
1 changed files with 2 additions and 1 deletions

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')
.description(__('run tests'))
.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;
if (node && !(node === 'embark' || node === 'vm' || node.match(urlRegexExp))) {
console.error(`invalid --node option: must be 'vm', 'embark' or a valid URL`.red);
process.exit(1);
}
options.node = node;
checkDeps();
i18n.setOrDetectLocale(options.locale);
embark.runTests({file, loglevel: options.loglevel, gasDetails: options.gasDetails,