mirror of
https://github.com/nodejs/node.git
synced 2025-12-28 07:50:41 +00:00
This test has been flaky in the CI. It squeezes too many independent test cases into one file, so split it up so that we can mark the persistent flaky test case and leave the unproblematic ones alone. PR-URL: https://github.com/nodejs/node/pull/60568 Refs: https://github.com/nodejs/node/issues/54803 Refs: https://github.com/nodejs/reliability/blob/main/reports/2025-11-03.md Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
25 lines
580 B
JavaScript
25 lines
580 B
JavaScript
// Regression tests for https://github.com/nodejs/node/issues/40623
|
|
// Test that timerify preserves return values and class constructor behavior.
|
|
|
|
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const { timerify } = require('perf_hooks');
|
|
|
|
assert.strictEqual(timerify(function func() {
|
|
return 1;
|
|
})(), 1);
|
|
assert.strictEqual(timerify(function() {
|
|
return 1;
|
|
})(), 1);
|
|
assert.strictEqual(timerify(() => {
|
|
return 1;
|
|
})(), 1);
|
|
class C {}
|
|
const wrap = timerify(C);
|
|
assert.ok(new wrap() instanceof C);
|
|
assert.throws(() => wrap(), {
|
|
name: 'TypeError',
|
|
});
|