Skip to content

Commit

Permalink
test: invoke callback with common.mustCall()
Browse files Browse the repository at this point in the history
* 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
Griffith Tchenpan authored and MylesBorins committed Sep 20, 2017
1 parent 32260b9 commit a284ee6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-crypto-hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit a284ee6

Please sign in to comment.