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 <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
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

Lines changed: 3 additions & 2 deletions
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)