Skip to content

Commit

Permalink
src: add/move hasCrypto checks for async tests
Browse files Browse the repository at this point in the history
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: nodejs#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]>
  • Loading branch information
danbev committed May 12, 2017
1 parent d7d16f7 commit 9f8e030
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
8 changes: 4 additions & 4 deletions test/async-hooks/test-crypto-pbkdf2.js
Original file line number Diff line number Diff line change
@@ -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();

Expand Down
8 changes: 4 additions & 4 deletions test/async-hooks/test-crypto-randomBytes.js
Original file line number Diff line number Diff line change
@@ -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();

Expand Down
4 changes: 4 additions & 0 deletions test/parallel/test-async-wrap-uncaughtexception.js
Original file line number Diff line number Diff line change
@@ -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];
Expand Down

0 comments on commit 9f8e030

Please sign in to comment.