From 88bf6fae45330e9f6c01bd6ab16969e6acc523e0 Mon Sep 17 00:00:00 2001 From: Ujjwal Sharma Date: Tue, 6 Mar 2018 12:08:44 +0530 Subject: [PATCH 1/2] test: replace third argument in assert.strictEqual Replace the third argument in assert.strictEqual with something much more informative so that it display relevant information when the test fails --- test/parallel/test-crypto-hmac.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-crypto-hmac.js b/test/parallel/test-crypto-hmac.js index 92fa16f98cda44..e4238e33743351 100644 --- a/test/parallel/test-crypto-hmac.js +++ b/test/parallel/test-crypto-hmac.js @@ -269,7 +269,11 @@ for (let i = 0, l = rfc4231.length; i < l; i++) { expected, `Test HMAC-${hash} rfc 4231 case ${i + 1}: ${actual} must be ${expected}` ); - assert.strictEqual(actual, strRes, 'Should get same result from stream'); + assert.strictEqual( + actual, + strRes, + `Should get same result from stream: ${actual} must be ${strRes}` + ); } } From e4cbf786d8175df9143418fcdf2dd494b535d90c Mon Sep 17 00:00:00 2001 From: Ujjwal Sharma Date: Tue, 6 Mar 2018 13:24:19 +0530 Subject: [PATCH 2/2] test: add more information to assert.strictEqual --- test/parallel/test-crypto-hmac.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-crypto-hmac.js b/test/parallel/test-crypto-hmac.js index e4238e33743351..0597891e0041a7 100644 --- a/test/parallel/test-crypto-hmac.js +++ b/test/parallel/test-crypto-hmac.js @@ -272,7 +272,8 @@ for (let i = 0, l = rfc4231.length; i < l; i++) { assert.strictEqual( actual, strRes, - `Should get same result from stream: ${actual} must be ${strRes}` + `Should get same result from stream (hash: ${hash} and case: ${i + 1})` + + ` => ${actual} must be ${strRes}` ); } }