aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-crypto.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-05-14 17:28:26 +0200
committerRuben Bridgewater <ruben@bridgewater.de>2018-05-18 15:59:40 +0200
commitdd9d32f94ce5ed6d136c16677ef323239e708e32 (patch)
treeed0cfac9a89a95674f03cd6920f926bd835956a2 /test/parallel/test-crypto.js
parenteeb1d514ad4a650f134b23b3eef3c854d0bc48a6 (diff)
downloadandroid-node-v8-dd9d32f94ce5ed6d136c16677ef323239e708e32.tar.gz
android-node-v8-dd9d32f94ce5ed6d136c16677ef323239e708e32.tar.bz2
android-node-v8-dd9d32f94ce5ed6d136c16677ef323239e708e32.zip
test: add eslint rule to verify assertion input
The input for `assert.deepStrictEqual` and similar expect the actual input first and the expected input as second argument. This verifies that this is actually done correct in our tests. This is important so the possible error message actually makes sense. PR-URL: https://github.com/nodejs/node/pull/20718 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-crypto.js')
-rw-r--r--test/parallel/test-crypto.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/parallel/test-crypto.js b/test/parallel/test-crypto.js
index 9a93e8422f..88d4916710 100644
--- a/test/parallel/test-crypto.js
+++ b/test/parallel/test-crypto.js
@@ -129,7 +129,7 @@ assert(tlsCiphers.every((value) => noCapitals.test(value)));
validateList(tlsCiphers);
// Assert that we have sha1 and sha256 but not SHA1 and SHA256.
-assert.notStrictEqual(0, crypto.getHashes().length);
+assert.notStrictEqual(crypto.getHashes().length, 0);
assert(crypto.getHashes().includes('sha1'));
assert(crypto.getHashes().includes('sha256'));
assert(!crypto.getHashes().includes('SHA1'));
@@ -139,7 +139,7 @@ assert(!crypto.getHashes().includes('rsa-sha1'));
validateList(crypto.getHashes());
// Assume that we have at least secp384r1.
-assert.notStrictEqual(0, crypto.getCurves().length);
+assert.notStrictEqual(crypto.getCurves().length, 0);
assert(crypto.getCurves().includes('secp384r1'));
assert(!crypto.getCurves().includes('SECP384R1'));
validateList(crypto.getCurves());