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.

PR-URL: #21046
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
Trott authored and targos committed Jun 20, 2018
1 parent f461ae2 commit 29593e2
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 29593e2

Please sign in to comment.