Skip to content

Commit

Permalink
test: remove test messages for assert.strictEqual
Browse files Browse the repository at this point in the history
Remove test messages for assert.strictEqual,
as the default messages are a better option.

PR-URL: #15995
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
  • Loading branch information
tisAliG authored and joyeecheung committed Oct 14, 2017
1 parent cbbc1e4 commit f4cab35
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/parallel/test-crypto-cipher-decipher.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function testCipher1(key) {
let txt = decipher.update(ciph, 'hex', 'utf8');
txt += decipher.final('utf8');

assert.strictEqual(txt, plaintext, 'encryption and decryption');
assert.strictEqual(txt, plaintext);

// streaming cipher interface
// NB: In real life, it's not guaranteed that you can get all of it
Expand All @@ -39,7 +39,7 @@ function testCipher1(key) {
dStream.end(ciph);
txt = dStream.read().toString('utf8');

assert.strictEqual(txt, plaintext, 'encryption and decryption with streams');
assert.strictEqual(txt, plaintext);
}


Expand All @@ -61,7 +61,7 @@ function testCipher2(key) {
let txt = decipher.update(ciph, 'base64', 'utf8');
txt += decipher.final('utf8');

assert.strictEqual(txt, plaintext, 'encryption and decryption with Base64');
assert.strictEqual(txt, plaintext);
}

testCipher1('MySecretKey123');
Expand Down Expand Up @@ -125,17 +125,17 @@ testCipher2(Buffer.from('0123456789abcdef'));
let txt;
assert.doesNotThrow(() => txt = decipher.update(ciph, 'base64', 'ucs2'));
assert.doesNotThrow(() => txt += decipher.final('ucs2'));
assert.strictEqual(txt, plaintext, 'decrypted result in ucs2');
assert.strictEqual(txt, plaintext);

decipher = crypto.createDecipher('aes192', key);
assert.doesNotThrow(() => txt = decipher.update(ciph, 'base64', 'ucs-2'));
assert.doesNotThrow(() => txt += decipher.final('ucs-2'));
assert.strictEqual(txt, plaintext, 'decrypted result in ucs-2');
assert.strictEqual(txt, plaintext);

decipher = crypto.createDecipher('aes192', key);
assert.doesNotThrow(() => txt = decipher.update(ciph, 'base64', 'utf-16le'));
assert.doesNotThrow(() => txt += decipher.final('utf-16le'));
assert.strictEqual(txt, plaintext, 'decrypted result in utf-16le');
assert.strictEqual(txt, plaintext);
}

// setAutoPadding/setAuthTag/setAAD should return `this`
Expand Down

0 comments on commit f4cab35

Please sign in to comment.