Skip to content

Commit 9f8e030

Browse files
committed
src: add/move hasCrypto checks for async tests
Currently when configured --without-ssl these test will fail. In test-crypto-pbkdf2.js and test-crypto-randomBytes.js the check exists but just need to be moved before the require of crypto. There was no check in test-async-wrap-uncaughtexception.js so one was added. PR-URL: #12968 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Luca Maraschi <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent d7d16f7 commit 9f8e030

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

test/async-hooks/test-crypto-pbkdf2.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
'use strict';
22

33
const common = require('../common');
4+
if (!common.hasCrypto) {
5+
common.skip('missing crypto');
6+
return;
7+
}
48
const assert = require('assert');
59
const tick = require('./tick');
610
const initHooks = require('./init-hooks');
711
const { checkInvocations } = require('./hook-checks');
812
const crypto = require('crypto');
913

10-
if (!common.hasCrypto) {
11-
common.skip('missing crypto');
12-
return;
13-
}
1414

1515
const hooks = initHooks();
1616

test/async-hooks/test-crypto-randomBytes.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
'use strict';
22

33
const common = require('../common');
4+
if (!common.hasCrypto) {
5+
common.skip('missing crypto');
6+
return;
7+
}
48
const assert = require('assert');
59
const tick = require('./tick');
610
const initHooks = require('./init-hooks');
711
const { checkInvocations } = require('./hook-checks');
812
const crypto = require('crypto');
913

10-
if (!common.hasCrypto) {
11-
common.skip('missing crypto');
12-
return;
13-
}
1414

1515
const hooks = initHooks();
1616

test/parallel/test-async-wrap-uncaughtexception.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
'use strict';
22

33
const common = require('../common');
4+
if (!common.hasCrypto) {
5+
common.skip('missing crypto');
6+
return;
7+
}
48
const assert = require('assert');
59
const async_hooks = require('async_hooks');
610
const call_log = [0, 0, 0, 0]; // [before, callback, exception, after];

0 commit comments

Comments
 (0)