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:
naris93 2018-10-12 10:47:42 -07:00 committed by Ruben Bridgewater
parent 83fa60b37b
commit a5a1e9a2e4
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762

View File

@ -28,7 +28,7 @@ const assert = require('assert');
const crypto = require('crypto');
const domain = require('domain');
function test(fn) {
const test = (fn) => {
const ex = new Error('BAM');
const d = domain.create();
d.on('error', common.mustCall(function(err) {
@ -38,7 +38,7 @@ function test(fn) {
throw ex;
});
d.run(cb);
}
};
test(function(cb) {
crypto.pbkdf2('password', 'salt', 1, 8, cb);