Skip to content

Commit

Permalink
chore: cleanup e-test
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Mar 17, 2022
1 parent 5ca6ea9 commit fa504a1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 deletions.
4 changes: 1 addition & 3 deletions src/e-auto-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ const markerFilePath = path.join(__dirname, '..', '.disable-auto-updates');

program
.description('Check for build-tools updates or enable/disable automatic updates')
.action(() => {
checkForUpdates();
});
.action(checkForUpdates);

program
.command('enable')
Expand Down
44 changes: 22 additions & 22 deletions src/e-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,33 @@ function runSpecRunner(config, script, runnerArgs) {
}

program
.arguments('[specRunnerArgs...]')
.argument('[specRunnerArgs...]')
.allowUnknownOption()
.option('--node', 'Run node spec runner', false)
.option('--nan', 'Run nan spec runner', false)
.option(
'--runners=<main|remote|native>',
"A subset of tests to run - either 'main', 'remote', or 'native', not used with either the node or nan specs",
)
.action((specRunnerArgs, options) => {
try {
const config = evmConfig.current();
if (options.node && options.nan) {
fatal(
'Can not run both node and nan specs at the same time, --node and --nan are mutually exclusive',
);
}
let script = './script/spec-runner.js';
if (options.node) {
script = './script/node-spec-runner.js';
}
if (options.nan) {
script = './script/nan-spec-runner.js';
}
ensureNodeHeaders(config);
runSpecRunner(config, script, specRunnerArgs);
} catch (e) {
fatal(e);
}
})
.parse(process.argv);

try {
const runnerArgs = program.parseOptions(process.argv).unknown;
const config = evmConfig.current();
if (program.node && program.nan) {
fatal(
'Can not run both node and nan specs at the same time, --node and --nan are mutually exclusive',
);
}
let script = './script/spec-runner.js';
if (program.node) {
script = './script/node-spec-runner.js';
}
if (program.nan) {
script = './script/nan-spec-runner.js';
}
ensureNodeHeaders(config);
runSpecRunner(config, script, runnerArgs);
} catch (e) {
fatal(e);
}

0 comments on commit fa504a1

Please sign in to comment.