mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00

Convert all anonymous callback functions in `test/addons/**/*.js` to use arrow functions, except for those in `test/addons/make-callback/test.js` (which reference `this`) `writing-tests.md` states to use arrow functions when appropriate. PR-URL: https://github.com/nodejs/node/pull/30131 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
10 lines
308 B
JavaScript
10 lines
308 B
JavaScript
'use strict';
|
|
const common = require('../../common');
|
|
const assert = require('assert');
|
|
const { runCall } = require(`./build/${common.buildType}/binding`);
|
|
|
|
runCall(5, common.mustCall((err, val) => {
|
|
assert.strictEqual(err, null);
|
|
assert.strictEqual(val, 10);
|
|
process.nextTick(common.mustCall());
|
|
}));
|