From a284ee6129d47f13940f701f2cf5a0b2b3e6ad81 Mon Sep 17 00:00:00 2001 From: Griffith Tchenpan Date: Sat, 17 Sep 2016 19:00:53 +1000 Subject: [PATCH] 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 Reviewed-By: James M Snell Reviewed-By: Rich Trott --- test/parallel/test-crypto-domain.js | 2 +- test/parallel/test-crypto-hash.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-crypto-domain.js b/test/parallel/test-crypto-domain.js index eda01b95b562e4..072cf80f7f9c05 100644 --- a/test/parallel/test-crypto-domain.js +++ b/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'); diff --git a/test/parallel/test-crypto-hash.js b/test/parallel/test-crypto-hash.js index 1d36753738e95f..1ac00216fd67b3 100644 --- a/test/parallel/test-crypto-hash.js +++ b/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() {