test: modernize test-crypto-domain
PR-URL: https://github.com/nodejs/node/pull/23559 Reviewed-By: Sam Ruby <rubys@intertwingly.net> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
parent
83fa60b37b
commit
a5a1e9a2e4
@ -28,7 +28,7 @@ const assert = require('assert');
|
|||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
const domain = require('domain');
|
const domain = require('domain');
|
||||||
|
|
||||||
function test(fn) {
|
const test = (fn) => {
|
||||||
const ex = new Error('BAM');
|
const ex = new Error('BAM');
|
||||||
const d = domain.create();
|
const d = domain.create();
|
||||||
d.on('error', common.mustCall(function(err) {
|
d.on('error', common.mustCall(function(err) {
|
||||||
@ -38,7 +38,7 @@ function test(fn) {
|
|||||||
throw ex;
|
throw ex;
|
||||||
});
|
});
|
||||||
d.run(cb);
|
d.run(cb);
|
||||||
}
|
};
|
||||||
|
|
||||||
test(function(cb) {
|
test(function(cb) {
|
||||||
crypto.pbkdf2('password', 'salt', 1, 8, cb);
|
crypto.pbkdf2('password', 'salt', 1, 8, cb);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user