Skip to content

Commit f3e3d79

Browse files
committed
test: updated to const and strictEqual
Upadted all var to const/let and updated assert.equal to assert.strictEqual
1 parent 8264a22 commit f3e3d79

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

test/parallel/test-crypto-pbkdf2.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
'use strict';
2-
var common = require('../common');
3-
var assert = require('assert');
2+
const common = require('../common');
3+
const assert = require('assert');
44

55
if (!common.hasCrypto) {
66
common.skip('missing crypto');
77
return;
88
}
9-
var crypto = require('crypto');
9+
const crypto = require('crypto');
1010

1111
//
1212
// Test PBKDF2 with RFC 6070 test vectors (except #4)
1313
//
1414
function testPBKDF2(password, salt, iterations, keylen, expected) {
15-
var actual = crypto.pbkdf2Sync(password, salt, iterations, keylen, 'sha256');
16-
assert.equal(actual.toString('latin1'), expected);
15+
const actual =
16+
crypto.pbkdf2Sync(password, salt, iterations, keylen, 'sha256');
17+
assert.strictEqual(actual.toString('latin1'), expected);
1718

1819
crypto.pbkdf2(password, salt, iterations, keylen, 'sha256', (err, actual) => {
19-
assert.equal(actual.toString('latin1'), expected);
20+
assert.strictEqual(actual.toString('latin1'), expected);
2021
});
2122
}
2223

@@ -44,15 +45,15 @@ testPBKDF2('pass\0word', 'sa\0lt', 4096, 16,
4445
'\x89\xb6\x9d\x05\x16\xf8\x29\x89\x3c\x69\x62\x26\x65' +
4546
'\x0a\x86\x87');
4647

47-
var expected =
48+
const expected =
4849
'64c486c55d30d4c5a079b8823b7d7cb37ff0556f537da8410233bcec330ed956';
49-
var key = crypto.pbkdf2Sync('password', 'salt', 32, 32, 'sha256');
50-
assert.equal(key.toString('hex'), expected);
50+
const key = crypto.pbkdf2Sync('password', 'salt', 32, 32, 'sha256');
51+
assert.strictEqual(key.toString('hex'), expected);
5152

5253
crypto.pbkdf2('password', 'salt', 32, 32, 'sha256', common.mustCall(ondone));
5354
function ondone(err, key) {
5455
if (err) throw err;
55-
assert.equal(key.toString('hex'), expected);
56+
assert.strictEqual(key.toString('hex'), expected);
5657
}
5758

5859
// Error path should not leak memory (check with valgrind).

0 commit comments

Comments
 (0)