From e4c320e5d75d7c3185eca750a201f3f6f62f3cab Mon Sep 17 00:00:00 2001 From: Piotr Grzesik Date: Sun, 25 Feb 2018 14:14:36 +0100 Subject: [PATCH] test: Remove unnecessary asserion messages in test-crypto-hash.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://github.com/nodejs/node/pull/18984 Reviewed-By: James M Snell Reviewed-By: Rich Trott Reviewed-By: Ruben Bridgewater Reviewed-By: Tobias Nießen --- test/parallel/test-crypto-hash.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-crypto-hash.js b/test/parallel/test-crypto-hash.js index bf080b1970369e..e425e1fe4cdb60 100644 --- a/test/parallel/test-crypto-hash.js +++ b/test/parallel/test-crypto-hash.js @@ -82,15 +82,15 @@ assert.deepStrictEqual( ); // stream interface should produce the same result. -assert.deepStrictEqual(a5, a3, 'stream interface is consistent'); -assert.deepStrictEqual(a6, a3, 'stream interface is consistent'); -assert.notStrictEqual(a7, undefined, 'no data should return data'); -assert.notStrictEqual(a8, undefined, 'empty string should generate data'); +assert.deepStrictEqual(a5, a3); +assert.deepStrictEqual(a6, a3); +assert.notStrictEqual(a7, undefined); +assert.notStrictEqual(a8, undefined); // Test multiple updates to same hash const h1 = crypto.createHash('sha1').update('Test123').digest('hex'); const h2 = crypto.createHash('sha1').update('Test').update('123').digest('hex'); -assert.strictEqual(h1, h2, 'multipled updates'); +assert.strictEqual(h1, h2); // Test hashing for binary files const fn = fixtures.path('sample.png');