Skip to content

Commit bb198dc

Browse files
Trottaddaleax
authored andcommitted
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: #13975 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
1 parent 4ba1d32 commit bb198dc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/parallel/test-crypto-pbkdf2.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
'use strict';
22
const common = require('../common');
3-
const assert = require('assert');
43

54
if (!common.hasCrypto) {
65
common.skip('missing crypto');
76
return;
87
}
8+
9+
const assert = require('assert');
910
const crypto = require('crypto');
1011

1112
//
@@ -98,7 +99,7 @@ assert.doesNotThrow(() => {
9899
});
99100

100101
assert.throws(() => {
101-
crypto.pbkdf2('password', 'salt', 8, 8, common.noop);
102+
crypto.pbkdf2('password', 'salt', 8, 8, common.mustNotCall());
102103
}, /^TypeError: The "digest" argument is required and must not be undefined$/);
103104

104105
assert.throws(() => {

0 commit comments

Comments
 (0)