From 9245559ae089dd7c3ef42a8f9f02819ce2232e59 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 --- 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(() => {