Skip to content

Commit 73e33ae

Browse files
committed
[Tests] avoid console logs
1 parent f2a258e commit 73e33ae

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

test/test.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ tape("hash is the same as node's crypto", function (t) {
3030
inputs.forEach(function (v) {
3131
var a = new Sha1().update(v[0], v[1]).digest('hex');
3232
var e = crypto.createHash('sha1').update(v[0], v[1]).digest('hex');
33-
console.log(a, '==', e);
34-
t.equal(a, e);
33+
t.equal(a, e, a + ' == ' + e);
3534
});
3635

3736
t.end();
@@ -50,8 +49,7 @@ tape('call update multiple times', function (t) {
5049

5150
var a = hash.digest('hex');
5251
var e = sha1hash.digest('hex');
53-
console.log(a, '==', e);
54-
t.equal(a, e);
52+
t.equal(a, e, a + ' == ' + e);
5553
});
5654
t.end();
5755
});
@@ -89,8 +87,7 @@ tape('hex encoding', function (t) {
8987
var a = hash.digest('hex');
9088
var e = sha1hash.digest('hex');
9189

92-
console.log(a, '==', e);
93-
t.equal(a, e);
90+
t.equal(a, e, a + ' == ' + e);
9491
});
9592

9693
t.end();
@@ -136,6 +133,6 @@ tape('call digest for more than MAX_UINT32 bits of data', function (t) {
136133
var a = hash.digest('hex');
137134
var e = sha1hash.digest('hex');
138135

139-
t.equal(a, e);
136+
t.equal(a, e, a + ' == ' + e);
140137
t.end();
141138
});

test/vectors.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ function makeTest(alg, i, verbose) {
1212

1313
tape(alg + ': NIST vector ' + i, function (t) {
1414
if (verbose) {
15-
console.log(v);
16-
console.log('VECTOR', i);
17-
console.log('INPUT', v.input);
18-
console.log(Buffer.from(v.input, 'base64').toString('hex'));
15+
t.comment(v);
16+
t.comment('VECTOR', i);
17+
t.comment('INPUT', v.input);
18+
t.comment(Buffer.from(v.input, 'base64').toString('hex'));
1919
}
2020

2121
var buf = Buffer.from(v.input, 'base64');
@@ -26,8 +26,8 @@ function makeTest(alg, i, verbose) {
2626
var buf1 = buf.slice(0, i);
2727
var buf2 = buf.slice(i, buf.length);
2828

29-
console.log(buf1.length, buf2.length, buf.length);
30-
console.log(createHash(alg)._block.length);
29+
t.comment(buf1.length + ', ' + buf2.length + ', ' + buf.length);
30+
t.comment(createHash(alg)._block.length);
3131

3232
t.equal(
3333
createHash(alg)

0 commit comments

Comments
 (0)