Browse Source

test: invoke callback with common.mustCall()

* invoke callback with `common.mustCall()` in test-crypto-hash
* order module declarations aphabetically per test-writing-guide

PR-URL: https://github.com/nodejs/node/pull/8597
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
v6.x
Griffith Tchenpan 8 years ago
committed by Myles Borins
parent
commit
a284ee6129
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 2
      test/parallel/test-crypto-domain.js
  2. 4
      test/parallel/test-crypto-hash.js

2
test/parallel/test-crypto-domain.js

@ -4,8 +4,8 @@ if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
const domain = require('domain');
const crypto = require('crypto');
const domain = require('domain');
function test(fn) {
const ex = new Error('BAM');

4
test/parallel/test-crypto-hash.js

@ -80,11 +80,11 @@ const fileStream = fs.createReadStream(fn);
fileStream.on('data', function(data) {
sha1Hash.update(data);
});
fileStream.on('close', function() {
fileStream.on('close', common.mustCall(function() {
assert.strictEqual(sha1Hash.digest('hex'),
'22723e553129a336ad96e10f6aecdf0f45e4149e',
'Test SHA1 of sample.png');
});
}));
// Issue #2227: unknown digest method should throw an error.
assert.throws(function() {

Loading…
Cancel
Save