Permalink
Browse files

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: #8597
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information...
griffithtp authored and MylesBorins committed Sep 17, 2016
1 parent a3feb54 commit 4205648216e26846530e9883980d2ccb4ab630f0
Showing with 5 additions and 4 deletions.
  1. +1 −1 test/parallel/test-crypto-domain.js
  2. +4 −3 test/parallel/test-crypto-hash.js
@@ -25,8 +25,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,8 +4,9 @@ if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
const fs = require('fs');
const crypto = require('crypto');
const fs = require('fs');
const fixtures = require('../common/fixtures');
// Test hashing
@@ -80,11 +81,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() {

0 comments on commit 4205648

Please sign in to comment.