Skip to content

Commit e4c320e

Browse files
pgrzesikMylesBorins
authored andcommitted
test: Remove unnecessary asserion messages in test-crypto-hash.js
This commit improves asserion messages in parallel/test-crypto-hash.js. Instead of just simple string literal, messages are changed to also include values used in assertion, which should improve debugging in case of errors. PR-URL: #18984 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
1 parent 3e6858e commit e4c320e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/parallel/test-crypto-hash.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ assert.deepStrictEqual(
8282
);
8383

8484
// stream interface should produce the same result.
85-
assert.deepStrictEqual(a5, a3, 'stream interface is consistent');
86-
assert.deepStrictEqual(a6, a3, 'stream interface is consistent');
87-
assert.notStrictEqual(a7, undefined, 'no data should return data');
88-
assert.notStrictEqual(a8, undefined, 'empty string should generate data');
85+
assert.deepStrictEqual(a5, a3);
86+
assert.deepStrictEqual(a6, a3);
87+
assert.notStrictEqual(a7, undefined);
88+
assert.notStrictEqual(a8, undefined);
8989

9090
// Test multiple updates to same hash
9191
const h1 = crypto.createHash('sha1').update('Test123').digest('hex');
9292
const h2 = crypto.createHash('sha1').update('Test').update('123').digest('hex');
93-
assert.strictEqual(h1, h2, 'multipled updates');
93+
assert.strictEqual(h1, h2);
9494

9595
// Test hashing for binary files
9696
const fn = fixtures.path('sample.png');

0 commit comments

Comments
 (0)