Skip to content

Commit 771568a

Browse files
committed
test: add test for timers benchmarks
PR-URL: #12851 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent dd06246 commit 771568a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
'use strict';
2+
3+
require('../common');
4+
5+
// Minimal test for timers benchmarks. This makes sure the benchmarks aren't
6+
// horribly broken but nothing more than that.
7+
8+
const assert = require('assert');
9+
const fork = require('child_process').fork;
10+
const path = require('path');
11+
12+
const runjs = path.join(__dirname, '..', '..', 'benchmark', 'run.js');
13+
const argv = ['--set', 'thousands=0.001',
14+
'--set', 'millions=0.000001',
15+
'timers'];
16+
17+
const child = fork(runjs, argv, {env: {NODEJS_BENCHMARK_ZERO_ALLOWED: 1}});
18+
child.on('exit', (code, signal) => {
19+
assert.strictEqual(code, 0);
20+
assert.strictEqual(signal, null);
21+
});

0 commit comments

Comments
 (0)