From 48660fbb9d161f91ca63d02f5fda34a97c53e1c2 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 28 Jun 2017 20:41:24 -0700 Subject: [PATCH] test: refactor test-crypto-pbkdf2 * re-order require() and crypto check per test writing guide * use common.mustNotCall() to confirm callback is not invoked PR-URL: https://github.com/nodejs/node/pull/13975 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Daniel Bevenius Reviewed-By: Colin Ihrig Reviewed-By: Refael Ackermann --- test/parallel/test-crypto-pbkdf2.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-crypto-pbkdf2.js b/test/parallel/test-crypto-pbkdf2.js index f35c8af274f857..9ed719c1f68358 100644 --- a/test/parallel/test-crypto-pbkdf2.js +++ b/test/parallel/test-crypto-pbkdf2.js @@ -1,11 +1,12 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } + +const assert = require('assert'); const crypto = require('crypto'); // @@ -98,7 +99,7 @@ assert.doesNotThrow(() => { }); assert.throws(() => { - crypto.pbkdf2('password', 'salt', 8, 8, common.noop); + crypto.pbkdf2('password', 'salt', 8, 8, common.mustNotCall()); }, /^TypeError: The "digest" argument is required and must not be undefined$/); assert.throws(() => {