Skip to content

Commit 57c98f1

Browse files
TrottMylesBorins
authored andcommitted
test: favor === over == in crypto tests
PR-URL: #8176 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent 11f761a commit 57c98f1

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

test/parallel/test-crypto-authenticated.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ var ciphers = crypto.getCiphers();
312312
for (var i in TEST_CASES) {
313313
var test = TEST_CASES[i];
314314

315-
if (ciphers.indexOf(test.algo) == -1) {
315+
if (ciphers.indexOf(test.algo) === -1) {
316316
common.skip('unsupported ' + test.algo + ' test');
317317
continue;
318318
}

test/parallel/test-crypto-hmac.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ var wikipedia = [
6262
for (let i = 0, l = wikipedia.length; i < l; i++) {
6363
for (const hash in wikipedia[i]['hmac']) {
6464
// FIPS does not support MD5.
65-
if (common.hasFipsCrypto && hash == 'md5')
65+
if (common.hasFipsCrypto && hash === 'md5')
6666
continue;
6767
const result = crypto.createHmac(hash, wikipedia[i]['key'])
6868
.update(wikipedia[i]['data'])

test/pummel/test-crypto-dh.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ for (const name in hashes) {
4242

4343
for (const name in hashes) {
4444
// modp1 is 768 bits, FIPS requires >= 1024
45-
if (name == 'modp1' && common.hasFipsCrypto)
45+
if (name === 'modp1' && common.hasFipsCrypto)
4646
continue;
4747
var group1 = crypto.getDiffieHellman(name);
4848
var group2 = crypto.getDiffieHellman(name);

0 commit comments

Comments
 (0)