Skip to content

Commit 3ca50a7

Browse files
committed
benchmark: improve cli error message
When no matching benchmark files are found, a more sensible error is shown now.
1 parent c05e5bf commit 3ca50a7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

benchmark/_cli.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ CLI.prototype.benchmarks = function() {
8888
const filter = this.optional.filter || false;
8989

9090
for (const category of this.items) {
91+
if (benchmarks[category] === undefined)
92+
continue;
9193
for (const scripts of benchmarks[category]) {
9294
if (filter && scripts.lastIndexOf(filter) === -1) continue;
9395

benchmark/compare.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const runs = cli.optional.runs ? parseInt(cli.optional.runs, 10) : 30;
3535
const benchmarks = cli.benchmarks();
3636

3737
if (benchmarks.length === 0) {
38-
console.error('no benchmarks found');
38+
console.error('No benchmarks found');
3939
process.exitCode = 1;
4040
return;
4141
}

0 commit comments

Comments
 (0)