Skip to content

Commit 137a84d

Browse files
committed
benchmark: add --test-reporter-destination to flags benchmarks
1 parent 04ec8dc commit 137a84d

File tree

5 files changed

+72
-38
lines changed

5 files changed

+72
-38
lines changed

benchmark/test_runner/global-concurrent-tests.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@
22
const common = require('../common');
33
const { it } = require('node:test');
44

5-
const bench = common.createBenchmark(main, {
6-
n: [100, 1000, 1e4],
7-
type: ['sync', 'async'],
8-
}, {
9-
// We don't want to test the reporter here
10-
flags: ['--test-reporter=./benchmark/fixtures/empty-test-reporter.js'],
11-
});
5+
const bench = common.createBenchmark(
6+
main,
7+
{
8+
n: [100, 1000, 1e4],
9+
type: ['sync', 'async'],
10+
},
11+
{
12+
// We don't want to test the reporter here
13+
flags: [
14+
'--test-reporter=./benchmark/fixtures/empty-test-reporter.js',
15+
'--test-reporter-destination=stdout',
16+
],
17+
},
18+
);
1219

1320
async function run(n, type) {
1421
const promises = new Array(n);

benchmark/test_runner/global-sequential-tests.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@
22
const common = require('../common');
33
const { it } = require('node:test');
44

5-
6-
const bench = common.createBenchmark(main, {
7-
n: [100, 1000, 1e4],
8-
type: ['sync', 'async'],
9-
}, {
10-
// We don't want to test the reporter here
11-
flags: ['--test-reporter=./benchmark/fixtures/empty-test-reporter.js'],
12-
});
5+
const bench = common.createBenchmark(
6+
main,
7+
{
8+
n: [100, 1000, 1e4],
9+
type: ['sync', 'async'],
10+
},
11+
{
12+
// We don't want to test the reporter here
13+
flags: [
14+
'--test-reporter=./benchmark/fixtures/empty-test-reporter.js',
15+
'--test-reporter-destination=stdout',
16+
],
17+
},
18+
);
1319

1420
async function run(n, type) {
1521
// eslint-disable-next-line no-unused-vars

benchmark/test_runner/mock-fn.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,20 @@ const common = require('../common');
44
const assert = require('node:assert');
55
const { test } = require('node:test');
66

7-
const bench = common.createBenchmark(main, {
8-
n: [1e6],
9-
mode: ['define', 'execute'],
10-
}, {
11-
// We don't want to test the reporter here
12-
flags: ['--test-reporter=./benchmark/fixtures/empty-test-reporter.js'],
13-
});
7+
const bench = common.createBenchmark(
8+
main,
9+
{
10+
n: [1e6],
11+
mode: ['define', 'execute'],
12+
},
13+
{
14+
// We don't want to test the reporter here
15+
flags: [
16+
'--test-reporter=./benchmark/fixtures/empty-test-reporter.js',
17+
'--test-reporter-destination=stdout',
18+
],
19+
},
20+
);
1421

1522
const noop = () => {};
1623

benchmark/test_runner/run-single-test-file.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,20 @@ function setup(numberOfTestFiles) {
3131
* Specifically, it compares the performance of running tests in the
3232
* same process versus creating multiple processes.
3333
*/
34-
const bench = common.createBenchmark(main, {
35-
numberOfTestFiles: [1, 10, 100],
36-
isolation: ['none', 'process'],
37-
}, {
38-
// We don't want to test the reporter here
39-
flags: ['--test-reporter=./benchmark/fixtures/empty-test-reporter.js'],
40-
});
34+
const bench = common.createBenchmark(
35+
main,
36+
{
37+
numberOfTestFiles: [1, 10, 100],
38+
isolation: ['none', 'process'],
39+
},
40+
{
41+
// We don't want to test the reporter here
42+
flags: [
43+
'--test-reporter=./benchmark/fixtures/empty-test-reporter.js',
44+
'--test-reporter-destination=stdout',
45+
],
46+
},
47+
);
4148

4249
async function runBenchmark({ numberOfTestFiles, isolation }) {
4350
const dirPath = getTestDirPath(numberOfTestFiles);

benchmark/test_runner/suite-tests.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,22 @@ const reporter = require('../fixtures/empty-test-reporter');
66

77
const { describe, it } = require('node:test');
88

9-
const bench = common.createBenchmark(main, {
10-
numberOfSuites: [10, 100],
11-
testsPerSuite: [10, 100, 1000],
12-
testType: ['sync', 'async'],
13-
concurrency: ['yes', 'no'],
14-
}, {
15-
// We don't want to test the reporter here
16-
flags: ['--test-reporter=./benchmark/fixtures/empty-test-reporter.js'],
17-
});
9+
const bench = common.createBenchmark(
10+
main,
11+
{
12+
numberOfSuites: [10, 100],
13+
testsPerSuite: [10, 100, 1000],
14+
testType: ['sync', 'async'],
15+
concurrency: ['yes', 'no'],
16+
},
17+
{
18+
// We don't want to test the reporter here
19+
flags: [
20+
'--test-reporter=./benchmark/fixtures/empty-test-reporter.js',
21+
'--test-reporter-destination=stdout',
22+
],
23+
},
24+
);
1825

1926
async function run({ numberOfSuites, testsPerSuite, testType, concurrency }) {
2027
concurrency = concurrency === 'yes';

0 commit comments

Comments
 (0)