test: invoke callback with common.mustCall() · nodejs/node@a284ee6

Original file line numberDiff line numberDiff line change

@@ -80,11 +80,11 @@ const fileStream = fs.createReadStream(fn);

8080

fileStream.on('data', function(data) {

8181

sha1Hash.update(data);

8282

});

83-

fileStream.on('close', function() {

83+

fileStream.on('close', common.mustCall(function() {

8484

assert.strictEqual(sha1Hash.digest('hex'),

8585

'22723e553129a336ad96e10f6aecdf0f45e4149e',

8686

'Test SHA1 of sample.png');

87-

});

87+

}));

8888
8989

// Issue #2227: unknown digest method should throw an error.

9090

assert.throws(function() {