Skip to content

Commit 29593e2

Browse files
Trotttargos
authored andcommitted
test: run misc benchmark only once in tests
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>
1 parent f461ae2 commit 29593e2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

benchmark/misc/util-extend-vs-object-assign.js

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ const bench = common.createBenchmark(main, {
99
});
1010

1111
function main({ n, type }) {
12+
// Default value for tests.
13+
if (type === '')
14+
type = 'extend';
15+
1216
let fn;
1317
if (type === 'extend') {
1418
fn = util._extend;

test/parallel/test-benchmark-misc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ runBenchmark('misc', [
99
'dur=0.1',
1010
'method=',
1111
'n=1',
12-
'type=extend',
13-
'val=magyarország.icom.museum'
12+
'type=',
13+
'val=magyarország.icom.museum',
1414
], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });

0 commit comments

Comments
 (0)