diff --git a/cmd/cmd.js b/cmd/cmd.js index 63faa63be..6e1981b3c 100644 --- a/cmd/cmd.js +++ b/cmd/cmd.js @@ -262,9 +262,14 @@ class Cmd { } test() { + const urlRegexExp = /^(vm|embark|((ws|https?):\/\/([a-zA-Z0-9_.-]*):?([0-9]*)?))$/i; program .command('test [file]') - .option('-n , --node [node]', __('Node to connect to (default: vm)')) + .option('-n , --node ', __('Node to connect to. Valid values are ["vm", "embark", ""]: \n') + + ' vm - ' + __('Starts an Ethereum simulator (ganache) and runs the tests using the simulator') + '\n' + + ' embark - ' + __('Uses the node associated with an already running embark process') + '\n' + + ' ' + __(' - Connects to a running node available at the end point and uses it to run the tests'), + urlRegexExp, 'vm') .option('-d , --gasDetails', __('When set, will print the gas cost for each contract deploy')) .option('-c , --coverage', __('When set, will generate the coverage after the tests')) .option('--locale [locale]', __('language to use (default: en)')) diff --git a/lib/tests/test.js b/lib/tests/test.js index 9345f8f7b..0c7c636d1 100644 --- a/lib/tests/test.js +++ b/lib/tests/test.js @@ -58,7 +58,7 @@ class Test { }); } - if (this.simOptions.host || this.options.node) { + if (this.simOptions.host || (this.options.node && this.options.node !== 'vm')) { let options = this.simOptions; if (this.options.node) { options = utils.deconstructUrl(this.options.node);