diff --git a/test/async-hooks/test-crypto-pbkdf2.js b/test/async-hooks/test-crypto-pbkdf2.js index f2a0d208ed4ccb..938a14c16f5e52 100644 --- a/test/async-hooks/test-crypto-pbkdf2.js +++ b/test/async-hooks/test-crypto-pbkdf2.js @@ -1,16 +1,16 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} const assert = require('assert'); const tick = require('./tick'); const initHooks = require('./init-hooks'); const { checkInvocations } = require('./hook-checks'); const crypto = require('crypto'); -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} const hooks = initHooks(); diff --git a/test/async-hooks/test-crypto-randomBytes.js b/test/async-hooks/test-crypto-randomBytes.js index 0b89fcc09c7794..7748db482bc7bb 100644 --- a/test/async-hooks/test-crypto-randomBytes.js +++ b/test/async-hooks/test-crypto-randomBytes.js @@ -1,16 +1,16 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} const assert = require('assert'); const tick = require('./tick'); const initHooks = require('./init-hooks'); const { checkInvocations } = require('./hook-checks'); const crypto = require('crypto'); -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} const hooks = initHooks(); diff --git a/test/parallel/test-async-wrap-uncaughtexception.js b/test/parallel/test-async-wrap-uncaughtexception.js index 099bdb70dd97fe..c6ff06397e26d1 100644 --- a/test/parallel/test-async-wrap-uncaughtexception.js +++ b/test/parallel/test-async-wrap-uncaughtexception.js @@ -1,6 +1,10 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} const assert = require('assert'); const async_hooks = require('async_hooks'); const call_log = [0, 0, 0, 0]; // [before, callback, exception, after];