node/test/addons/async-hello-world/test-makecallback.js
garygsc 79faa87502
test: use arrow functions in addons tests
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>
2019-11-30 18:08:59 +01:00

11 lines
324 B
JavaScript

'use strict';
const common = require('../../common');
const assert = require('assert');
const { runMakeCallback } = require(`./build/${common.buildType}/binding`);
runMakeCallback(5, common.mustCall((err, val) => {
assert.strictEqual(err, null);
assert.strictEqual(val, 10);
process.nextTick(common.mustCall());
}));