Skip to content

Commit

Permalink
test: run misc benchmark only once in tests
Browse files Browse the repository at this point in the history
Prevent misc benchmark files from running more than one benchmark
during tests.
  • Loading branch information
Trott committed Jun 2, 2018
1 parent 6168959 commit 3ffd9ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions benchmark/misc/util-extend-vs-object-assign.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ const bench = common.createBenchmark(main, {
});

function main({ n, type }) {
// Default value for tests.
if (type === '')
type = 'extend';

let fn;
if (type === 'extend') {
fn = util._extend;
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-benchmark-misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ runBenchmark('misc', [
'dur=0.1',
'method=',
'n=1',
'type=extend',
'val=magyarország.icom.museum'
'type=',
'val=magyarország.icom.museum',
], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });

0 comments on commit 3ffd9ee

Please sign in to comment.