Skip to content

Commit 4205648

Browse files
Griffith TchenpanMylesBorins
Griffith Tchenpan
authored andcommitted
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 <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent a3feb54 commit 4205648

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

test/parallel/test-crypto-domain.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ if (!common.hasCrypto)
2525
common.skip('missing crypto');
2626

2727
const assert = require('assert');
28-
const domain = require('domain');
2928
const crypto = require('crypto');
29+
const domain = require('domain');
3030

3131
function test(fn) {
3232
const ex = new Error('BAM');

test/parallel/test-crypto-hash.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ if (!common.hasCrypto)
44
common.skip('missing crypto');
55

66
const assert = require('assert');
7-
const fs = require('fs');
87
const crypto = require('crypto');
8+
const fs = require('fs');
9+
910
const fixtures = require('../common/fixtures');
1011

1112
// Test hashing
@@ -80,11 +81,11 @@ const fileStream = fs.createReadStream(fn);
8081
fileStream.on('data', function(data) {
8182
sha1Hash.update(data);
8283
});
83-
fileStream.on('close', function() {
84+
fileStream.on('close', common.mustCall(function() {
8485
assert.strictEqual(sha1Hash.digest('hex'),
8586
'22723e553129a336ad96e10f6aecdf0f45e4149e',
8687
'Test SHA1 of sample.png');
87-
});
88+
}));
8889

8990
// Issue #2227: unknown digest method should throw an error.
9091
assert.throws(function() {

0 commit comments

Comments
 (0)