--coverage option only support "vm" node

This commit is contained in:
Michael Bradley, Jr 2018-09-18 15:05:52 -05:00
parent 98ff018967
commit dbac72ea7d
1 changed files with 6 additions and 1 deletions

View File

@ -272,7 +272,7 @@ class Cmd {
' embark - ' + __('Uses the node associated with an already running embark process') + '\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')) ' ' + __('<custom node endpoint> - Connects to a running node available at the end point and uses it to run the tests'))
.option('-d , --gasDetails', __('When set, will print the gas cost for each contract deployment')) .option('-d , --gasDetails', __('When set, will print the gas cost for each contract deployment'))
.option('-c , --coverage', __('When set, will generate the coverage after the tests')) .option('-c , --coverage', __('generate a coverage report after running the tests (vm only)'))
.option('--locale [locale]', __('language to use (default: en)')) .option('--locale [locale]', __('language to use (default: en)'))
.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'))
@ -285,6 +285,11 @@ class Cmd {
process.exit(1); process.exit(1);
} }
options.node = node; options.node = node;
if (options.coverage && options.node !== 'vm') {
console.error(`invalid --node option: coverage supports "vm" only\n`.red);
options.outputHelp();
process.exit(1);
}
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,