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: #12968
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Luca Maraschi <luca.maraschi@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • 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.