Merge pull request #823 from embark-framework/features/embark-help-addition

`embark test —node` help, plus fix for vm option
This commit is contained in:
Iuri Matias 2018-09-14 18:13:07 -04:00 committed by GitHub
commit 3c167b197c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -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>', __('Node to connect to. Valid values are ["vm", "embark", "<custom node endpoint>"]: \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' +
' ' + __('<custom node endpoint> - 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)'))

View File

@ -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);